rounk-ctrl / win32-darkmode

wip header
GNU General Public License v3.0
11 stars 0 forks source link

Failed to register the window class, resulting in program exit #2

Open 1821746019 opened 7 months ago

1821746019 commented 7 months ago

I am very eager to enable dark mode for everything, including Bandizip and Process Hacker. utools_1710663215697

When I launch the demo, Controls.exe, no window is created or shown. Upon debugging, I discovered that MyRegisterClass returns 0, indicating that the window class registration failed.

I look forward to your response. I would appreciate it if you could provide me with some guidance on how to achieve my goals. image image image

rounk-ctrl commented 7 months ago

weird, it works for me. maybe its failing to get the theme color.

try replacing at line 28, 29, 30 with

    HTHEME them = OpenThemeData(0, IsDarkMode ? L"DarkMode::ItemsView" : L"ItemsView");
    GetThemeColor(them, 0, 0, TMT_FILLCOLOR, &clr);
    GetThemeColor(them, 0, 0, TMT_TEXTCOLOR, &clrTxt);
rounk-ctrl commented 7 months ago

oh, also build in release. for whatever reason idk it fails to work when you build with debug

1821746019 commented 7 months ago

There is the same result after replacing in all the build configuarations image

1821746019 commented 7 months ago

Is it normal that both szTitle and szWindowClass are empty string after LoadStringW? image

rounk-ctrl commented 6 months ago

weird, does this work? Controls.zip

1821746019 commented 6 months ago

Yes, it works. How did you do it? Clip_2024-03-31_13-57-22

rounk-ctrl commented 6 months ago

i just built it in x64 release...

1821746019 commented 6 months ago

I cloned the repository again and opened it in VS2022. Without modifying any configurations, I built the solution. A window appeared, but the dark mode seemed not to work properly. Clip_2024-04-02_09-07-04