Foro de elhacker.net

Programación => ASM => Mensaje iniciado por: Riki_89D en 23 Abril 2010, 21:38 pm



Título: Color de fondo,no coinicde!
Publicado por: Riki_89D en 23 Abril 2010, 21:38 pm
Hola como estan?

bueno miren esta imagen:

(http://r.i.elhacker.net/cache?url=http://adriknet.freehostia.com/Dibujo.bmp)


fijense el fondo s blanco pero el control static en donde pone programa para palmyra es como mas gris,intente con esto:
Código:
invoke GetDC,handle_del_static
invoke SetBkColor,eax,COLOR_WINDOW


pero nada no cambia,como puedo ponerlos del mismo color?


salu2


Título: Re: Color de fondo,no coinicde!
Publicado por: MCKSys Argentina en 24 Abril 2010, 20:58 pm
Y con SendMessage?

EM_SETBKGNDCOLOR
The EM_SETBKGNDCOLOR message sets the background color for a rich edit control.

EM_SETBKGNDCOLOR
wParam = (WPARAM) (BOOL) fUseSysColor;
lParam = (LPARAM) (COLORREF) clr;
 
Parameters
fUseSysColor
Value specifying whether to use the system color. If this parameter is nonzero, the background is set to the window background system color. Otherwise, the background is set to the specified color.
clr
COLORREF structure specifying the color if fUseSysColor is zero.
Return Values
Returns the old background color.


Seria algo así:

Código:
invoke GetDC,handle_del_static
invoke SendMessage,eax,EM_SETBKGNDCOLOR,1,0

wParam es 1, por lo que se usa el color por defecto del sistema. Si usas un 0 en wParam, en lParam le deberás pasar el color que quieres, de acuerdo a:


COLORREF
The COLORREF value is a 32-bit value used to specify an RGB color.

Remarks
When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form:

0x00bbggrr
 
The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.


Saludos!


Título: Re: Color de fondo,no coinicde! [SOLUCIONADO]
Publicado por: Riki_89D en 24 Abril 2010, 22:26 pm
Pues ya esta solucionado ^^

para quien le interese solo habia que procesar el mensaje WM_CTLCOLORSTATIC

i despues configurar con:
Código:
invoke SetBkMode,HDC,TRANSPARENT

y listo fuera fondo feo!
xD

salu2