Win32: How can i set the color of windows Title, Scrollbar etc.?

前端 未结 2 1407
一个人的身影
一个人的身影 2021-01-22 17:21

I am updating a GUI of a Win32 Application in white text on black background. Thats simple for my content. But how can i change also the color of my child windows (Titlebar, Scr

相关标签:
2条回答
  • 2021-01-22 18:03

    You can use SetSysColors() to change the colour for window captions, borders, etc. (see http://msdn.microsoft.com/en-us/library/ms724940(VS.85).aspx). However this will change the colour for all windows, not just yours, so it is at the least an unfriendly thing to do.

    One option is to use SetSysColors() to change the active window caption colour when your application has focus and to reset it to the defaults when it loses focus. But I'd say that's klunky and not really in keeping with good practice (suppose your application crashes? and there might be some flickering).

    WM_NCPAINT is there so that you can do things like this. It is a bit of a pain, but maybe that's to discourage you from creating non-standard windows... ;-)

    0 讨论(0)
  • 2021-01-22 18:20

    Hook GetSysColor() (Using something like Microsoft Detours)

    0 讨论(0)
提交回复
热议问题