www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How does one attach a manifest file to a D executable on Windows?

reply solidstate1991 <laszloszeremi outlook.com> writes:
I have tried resource compiling, then using `dflags` in dug to 
add the resulting obj file, but I still get the issue of the old 
GUI style.
May 24
parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Friday, 24 May 2024 at 19:07:24 UTC, solidstate1991 wrote:
 I have tried resource compiling, then using `dflags` in dug to 
 add the resulting obj file, but I still get the issue of the 
 old GUI style.
I did that before, but I don't remember now. Probably you will figure that out based on this. https://gitlab.com/aferust/gtkdappcreator/-/tree/master/win_res?ref_type=heads
May 24
parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Friday, 24 May 2024 at 21:04:53 UTC, Ferhat Kurtulmuş wrote:
 On Friday, 24 May 2024 at 19:07:24 UTC, solidstate1991 wrote:
 I have tried resource compiling, then using `dflags` in dug to 
 add the resulting obj file, but I still get the issue of the 
 old GUI style.
I did that before, but I don't remember now. Probably you will figure that out based on this. https://gitlab.com/aferust/gtkdappcreator/-/tree/master/win_res?ref_type=heads
I think this is what you need https://github.com/aferust/doitlater/tree/master/views/res
May 24
parent reply solidstate1991 <laszloszeremi outlook.com> writes:
On Friday, 24 May 2024 at 21:26:12 UTC, Ferhat Kurtulmuş wrote:
 I think this is what you need

 https://github.com/aferust/doitlater/tree/master/views/res
No, I meant something like this: https://learn.microsoft.com/en-us/windows/win32/controls/cookbook-overview
May 25
parent reply John Chapman <john.chapman live.com> writes:
On Saturday, 25 May 2024 at 13:13:08 UTC, solidstate1991 wrote:
 No, I meant something like this:

 https://learn.microsoft.com/en-us/windows/win32/controls/cookbook-overview
Not tested but from memory I do this: 1) Copy that first XML snippet from the page you linked, save to a file called example.exe.manifest 2) Create a resource script file called resources.rc, with this at the top: 1 24 "example.exe.manifest" 3) Compile it with rc.exe 4) Include the resulting resources.res on your DMD command line You might also need to call InitCommonControls or InitCommonControlsEx before creating any windows.
May 25
next sibling parent solidstate1991 <laszloszeremi outlook.com> writes:
On Saturday, 25 May 2024 at 19:51:25 UTC, John Chapman wrote:
 Not tested but from memory I do this:

 1) Copy that first XML snippet from the page you linked, save 
 to a file called example.exe.manifest
 2) Create a resource script file called resources.rc, with this 
 at the top:
    1 24 "example.exe.manifest"
 3) Compile it with rc.exe
 4) Include the resulting resources.res on your DMD command line

 You might also need to call InitCommonControls or 
 InitCommonControlsEx before creating any windows.
Did just that too, didn't change anything.
Jun 02
prev sibling parent reply solidstate1991 <laszloszeremi outlook.com> writes:
On Saturday, 25 May 2024 at 19:51:25 UTC, John Chapman wrote:
 Not tested but from memory I do this:

 1) Copy that first XML snippet from the page you linked, save 
 to a file called example.exe.manifest
 2) Create a resource script file called resources.rc, with this 
 at the top:
    1 24 "example.exe.manifest"
 3) Compile it with rc.exe
 4) Include the resulting resources.res on your DMD command line

 You might also need to call InitCommonControls or 
 InitCommonControlsEx before creating any windows.
Added a few more line to my `resources.rc` file, it seems like the issue is the resource file not being touched at all. I've put `dflags "resources.res" platform="windows"` in my `dub.sdl` file, it doesn't even care if there's a typo in the resource file's path.
Jun 02
parent reply solidstate1991 <laszloszeremi outlook.com> writes:
On Sunday, 2 June 2024 at 19:11:10 UTC, solidstate1991 wrote:
 Added a few more line to my `resources.rc` file, it seems like 
 the issue is the resource file not being touched at all.

 I've put `dflags "resources.res" platform="windows"` in my 
 `dub.sdl` file, it doesn't even care if there's a typo in the 
 resource file's path.
Well, it turns out I used the windres found in mingw instead of `rc.exe` since the latter cannot be found anywhere on my PC, even after reinstalling stuff. I need to hunt it down somehow.
Jun 02
parent John Chapman <john.chapman live.com> writes:
On Sunday, 2 June 2024 at 21:46:41 UTC, solidstate1991 wrote:
 Well, it turns out I used the windres found in mingw instead of 
 `rc.exe` since the latter cannot be found anywhere on my PC, 
 even after reinstalling stuff. I need to hunt it down somehow.
rc.exe comes with the Windows SDK - it gets installed in one of the subfolders of "C:\Program Files (x86)\Windows Kits\10\bin" (on my machine it's in "10.0.22000.0\x64").
Jun 02