hi all, i need to set a bkcolor to a somple label i've search a lot on API help for a WM_ or EM_ but i couldn't find nothing. If some help ... Thanx
Posted on 2001-04-19 18:02:00 by angelo
WM_CTLCOLORSTATIC 

hdcStatic = (HDC) wParam;   // handle of display context 
hwndStatic = (HWND) lParam; // handle of static control 
 

The WM_CTLCOLORSTATIC message is sent to the parent window of a static control when the control is about to be drawn. By responding to this message, the parent window can use the given device context handle to set the text and background colors of the static control. 

Parameters

hdcStatic

Value of wParam. Identifies the device context for the static control window. 

hwndStatic

Value of lParam. Identifies the static control. 

Return Value

If an application processes this message, the return value is the handle of a brush that Windows uses to paint the background of the static control. 

Default Action

The DefWindowProc function selects the default system colors for the static control. 

Remarks

The WM_CTLCOLORSTATIC message is never sent between threads; it is sent only within the same thread. 
You cannot use a custom palette to set a static control's text or background color. Although the SelectPalette and RealizePalette functions will succeed, they will have no effect on the static control.
Posted on 2001-04-19 18:08:00 by HeroInc
Q: How do you respond? I created a brush and then I tried to intercept WM_CTLCOLORSTATIC then I used 'invoke ReplyMessage, Handle_of_my_brush' but it didnt work... probably that's not the proper way to do it.. any suggestions? thanks, clip
Posted on 2001-04-20 02:27:00 by clip
.ELSEIF uMsg==WM_CTLCOLORSTATIC invoke GetDlgItem,hWin,IDC_TEXT .IF eax==lParam invoke SetBkMode,wParam,1 invoke SetTextColor,wParam,Blue invoke GetStockObject,LTGRAY_BRUSH ret .ENDIF hope that helps, it sets the text to blue, and you have to return, that way shows how to set it for one specific control, and not all of them if you want it for all static controls go like this: .ELSEIF uMsg==WM_CTLCOLORSTATIC invoke SetBkMode,wParam,1 invoke SetTextColor,wParam,Blue invoke GetStockObject,LTGRAY_BRUSH ret don't forget return (ret) SetBkMode,wParam,1 sets the background to transparent if you wanna change the background color use SetBkColor, just look it up in your api ref Hope that helps, Olli This message was edited by Typhoon, on 4/20/2001 11:55:12 PM
Posted on 2001-04-20 23:51:00 by Typhoon