From: Jimbo on
Hello

I am trying to change the colour of a button when an event occurs(when
I open a colour dialog & select a new colour).

So I want to send a WM_DRAWITEM message to my WNDPROC so I need to use
this function:

SendMessage(hwnd, WM_DRAWITEM, (WPARAM) buttonID, (LPARAM) (??buttons
DRAWITEMSTRUCT) );

So I need to send a DRAWITEMSTRUCT associated with the button as the
lParam parameter for the above function.

My Problem:
I dont know how to get the DRAWITEMSTRUCT associated with the button
control? Can you help me find out how I can send a DRAWITEMSTRUCT as
the lParam parameter? I need to get access the DRAWITEMSTRUCT
associated with my button.

If you dont know what the DRAWITEMSTRUCT is, it contains all the
information about the button, like its text & bk colour, its style
etc.
http://msdn.microsoft.com/en-us/library/bb775802(VS.85).aspx
From: ScottMcP [MVP] on
On May 14, 8:23 pm, Jimbo <nill...(a)yahoo.com> wrote:
> Hello
>
> I am trying to change the colour of a button when an event occurs(when
> I open a colour dialog & select a new colour).
>
> So I want to send a WM_DRAWITEM message to my WNDPROC

That's the wrong approach. Do InvalidateRect on the button and it
will send the WM_DRAWITEM.