Hi

I'd like to know how to change the background color of a control. I have a Label and I'ld like to change the background to red...

If someone could help ...

Thanks a lot
Posted on 2006-07-06 14:06:29 by Fearo
Create a brush of required color :

invoke CreateSolidBrush, color_value 
mov , eax


Then in the main message procedure:

.elseif uMsg == WM_CTLCOLORSTATIC
mov eax, lParam
.if eax == handle_of_your_static_control
invoke SetBkMode, wParam, TRANSPARENT
mov eax,
ret
.endif


If you want to set differnet text color than use SetTextColor.

Posted on 2006-07-06 14:58:10 by arafel

Create a brush of required color :

invoke CreateSolidBrush, color_value 
mov , eax


Then in the main message procedure:

.elseif uMsg == WM_CTLCOLORSTATIC
mov eax, lParam
.if eax == handle_of_your_static_control
invoke SetBkMode, wParam, TRANSPARENT
mov eax,
ret
.endif


If you want to set differnet text color than use SetTextColor.




I don't know what file to include or lib to use for SetBkmode, createSolidBrush and all...

I already have :

include \masm32\include\windows.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\shell32.inc
includelib \masm32\lib\shell32.lib
include \masm32\include\comctl32.inc
includelib \masm32\lib\comctl32.lib
include \masm32\include\comdlg32.inc
includelib \masm32\lib\comdlg32.lib
Posted on 2006-07-06 17:10:54 by Fearo
If you have the Win32.hlp file then you can search for SetBkmode and click on the Quick Info Button. This will tell you the name of the .lib it's in - in this case gdi32.lib. So you will need to include gdi32.inc & gdi32.lib.

Posted on 2006-07-06 17:18:28 by JimmyClif

If you have the Win32.hlp file then you can search for SetBkmode and click on the Quick Info Button. This will tell you the name of the .lib it's in - in this case gdi32.lib. So you will need to include gdi32.inc & gdi32.lib.



Thanks a lot, it's finally working ! And also thanks for the Quick Info tips ^^
Posted on 2006-07-13 00:52:27 by Fearo