www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Windows Resource Files and DUB

reply Alexander <roland.taverner gmail.com> writes:
There is a [Using Windows Resource Files with 
D2](https://wiki.dlang.org/Using_Windows_Resource_Files_with_D2) 
article, but it says nothing about DUB and is probably somewhat 
outdated.
So what actually works in `dub.json` (assuming the file 
`resource\my.res` exists):
```
{
   "dflags": ["-L/SUBSYSTEM:WINDOWS", "-Lresource\\my.res"]
}
```
Jun 08
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Monday, 8 June 2026 at 18:25:00 UTC, Alexander wrote:
 There is a [Using Windows Resource Files with
curious, what do you put in your resource file? i recently added exe icon support built into opend (and hipreme merged that into his `redub` program too) but the rest i barely touch anymore.
Jun 08
parent reply Alexander <roland.taverner gmail.com> writes:
On Monday, 8 June 2026 at 18:32:14 UTC, Adam D. Ruppe wrote:
 On Monday, 8 June 2026 at 18:25:00 UTC, Alexander wrote:
 There is a [Using Windows Resource Files with
curious, what do you put in your resource file? i recently added exe icon support built into opend (and hipreme merged that into his `redub` program too) but the rest i barely touch anymore.
Right now just app icon and version info, but I also need menu, dialog and some more icons to indicate status. I want to implement system tray icon and right-click menu there. And maybe dialog window with logs and/or status and info.
Jun 08
parent Adam D. Ruppe <destructionator gmail.com> writes:
On Monday, 8 June 2026 at 18:43:20 UTC, Alexander wrote:
 Right now just app icon and version info, but I also need menu, 
 dialog and some more icons to indicate status. I want to 
 implement system tray icon and right-click menu there. And 
 maybe dialog window with logs and/or status and info.
I see. I tend to do all that stuff in code, can `import()` files in D and stuff too, but still either way works. So generally speaking, if you pass the .res file to the compiler, it knows how to forward it to the linker. Passing it as a dub sourceFiles should work too. Then a preBuildCommand to run the resource compiler. (or do a regular makefile or something to generate it lol).
Jun 08