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?
change colors of gadgets?
-
BackupUser
- PureBasic Guru

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

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
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
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