In the winAPI, how do I change the window background colour?
For example,
wc.hbrBackground = ....;
is for setting the window background initially, but how do I change it there after?
Thanks.
Use the SetClassLongPtr function with the GCLP_HBRBACKGROUND argument:
SetClassLongPtr(windowHandle, GCLP_HBRBACKGROUND, brushHandle);
http://msdn.microsoft.com/en-us/library/ms633589%28VS.85%29.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With