PDA

Click to See Complete Forum and Search --> : How can I trigger the WM_CTLCOLORSTATIC message?


gfiorani
Aug 23rd, 2001, 07:33 AM
I am using WM_CTLCOLORSTATIC to change the color of a static control I have. The control is used as a color selector, so it changes color throughout the program. It says on MSDN that the WM_CTLCOLORxxxx is sent when the window is about to be drawn. Is there any way I can trigger this message. I have tried UpdateWindow(), but no luck. I currently have a method of triggering the message, but it involves

ShowWindow(hwnd, WM_HIDE);
ShowWindow(hwnd, WM_SHOW);

This produces an ugly flicker, especially on slower machines. Does anyone have any suggestions? Thanks.

kedaman
Aug 23rd, 2001, 08:16 AM
How about Sendmessage`?

gfiorani
Aug 23rd, 2001, 10:20 AM
Thanks for the quick reply. I couldn't seem to get anything to happen, even with SendMessage(). Perhaps I don't understand what actually changes the color of a window. It seems that the message gets called quite frequently, but doesn't really do anything unless the window is being redrawn. It seems that UpdateWindow() should work...but it doesn't. Ultimately, all I want to do is change the color of a static control on the fly. Thanks.