Results 1 to 3 of 3

Thread: How can I trigger the WM_CTLCOLORSTATIC message?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Sterling Heights, MI, USA
    Posts
    11

    How can I trigger the WM_CTLCOLORSTATIC message?

    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
    Code:
    ShowWindow(hwnd, WM_HIDE);
    ShowWindow(hwnd, WM_SHOW);
    This produces an ugly flicker, especially on slower machines. Does anyone have any suggestions? Thanks.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    How about Sendmessage`?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Sterling Heights, MI, USA
    Posts
    11
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width