change colors of gadgets?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by wickedRush.

I've tried repeatedly to change the background color of a gadget using API. Does anyone have a code sample to show how to properly do this?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by wickedRush.

Anyone ?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bodind.

Hello,
Just a litle help for you:

In your main proc, capture the WM_PAINT message, get a hdc for the handle of
your control and do it like this:

CASE %WM_PAINT
hdc = BeginPaint(hWnd, ps) 'initiates window painting
SetBkColor hdc, CouleurFond ' RGB value
CALL WndPaint(hWnd, hdc)
CALL EndPaint(hWnd, ps) 'ends window painting
FUNCTION = 0


It's from PowerBasic code, but the translation could be easy to do.

Dominique.

Dominique
Post Reply