Compiler: Dev-c+ v4.9.9.2
Operating System: Windows Vista
Hello, I am a novice c++/win32 programmer, and I am trying to change the background color of a win32 static control. I am attempting to do this by getting the HBRUSH handle of the static control through the win32 function:
1 2 3 4 5 6
|
SendMessage(
(HWND) hwnd,
WM_CTLCOLORSTATIC ,
(WPARAM) wParam,
(LPARAM) lParam
);
|
Now as you know this function returns a handle to the brush of the control. It seems to me that this return is only the value of the brush and not the actual brush, so I think that I would need to get the address of the return brush in order to actually change the background color of the control. However my problem is that, as a novice, I don't know how to get the address of such a return variable.
(Note: I know the variable must first exist or be declared outside of the function and be passed to it through a pointer or a reference.)
My questions are:
(1)How do you get the address of a return variable from a "non-application-defined" function such as SendMessage() or any Win32 api for that matter?
(2)Could you explain to me how how to change the background color of a static control?(I really don't know what I'm doing.)
Thank you very much for your help. THANK YOU......