ysc3839 / win32-darkmode

Example application shows how to use undocumented dark mode API introduced in Windows 10 1809.
MIT License
437 stars 48 forks source link

Use with mingw64 (no SDK) #6

Open TheGreatRambler opened 4 years ago

TheGreatRambler commented 4 years ago

I wish to use this with the mingw64 api, which has the Windows headers but not the Windows SDK headers. In addition, if there was an easy way to call this as a function from a header to apply to any window, that would be awesome to know.

ysc3839 commented 4 years ago

What is "has the Windows headers but not the Windows SDK headers"? What errors did you get? I don't use mingw, maybe later when I have time I will test it.

to apply to any window

This is not easy to do, maybe by hooking CreateWindowEx. But I don't think it's a good solution.

TheGreatRambler commented 4 years ago

I don't exactly recall which headers, but a few were not present on my machine. I looked them up and it stated that they were a part of the Windows SDK. I have certain headers, like Windows.h however. When I say any window, I still have access to the window on creation, using wxwidgets, and I am able to obtain the hWnd, which I noticed this library takes as an argument to apply dark mode.

ysc3839 commented 4 years ago

Applying darkmode on top-level window is not enough. You have to apply to every child window. If you have the hWnd of top-level window, you can do a recursive enum of child window.

TheGreatRambler commented 4 years ago

What functions in DarkMode.h would I have to use on each child window?