-
January 2nd, 2014, 04:59 PM
#10
Re: [win32] - creating controls using class's
Originally Posted by 2kaud
If you really want the code to set the text/background colour to be in the child procedure window, you could do something like this
in child window procedure
Code:
case WM_CTLCOLORSTATIC:
{
HDC hdc = (HDC)wParam;
SetTextColor(hdc, RGB(0, 0, 0));
SetBkColor(hdc, RGB(255,0,0));
return (LRESULT)GetStockObject(GRAY_BRUSH);
}
in parent window procedure
Code:
case WM_CTLCOLORSTATIC:
return SendMessage((HWND)lParam, WM_CTLCOLORSTATIC, wParam, lParam);
This works because for the WM_CTLCOLORSTATIC message sent to the control parent window, lParam is a handle to the child window from which the request came.
thanks for that.
let me ask 1 thing: when i use WM_PAINT in my child window(my label class), why the mouse messages aren't activated?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|