View previous topic :: View next topic |
Author |
Message |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu May 20, 2010 1:40 am Post subject: Setting the background of a static control C |
|
|
I created a static control on a window that created with background style: COLOR_3DHIGHLIGHT.
And the background of the static control still has the default color of the gray window as you can see at the picture:
[img]
http://img38.yfrog.com/img38/1719/staticr.jpg
[/img]
how would i set it's background to the window's color?
_________________
Stylo |
|
Back to top |
|
 |
Dami Master Cheater
Reputation: 0
Joined: 23 Oct 2006 Posts: 336
|
Posted: Thu May 20, 2010 8:15 am Post subject: |
|
|
I was actually just wondering this same thing as i just picked up with Win32 API c++~
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Thu May 20, 2010 9:12 am Post subject: |
|
|
uggh, this is one of the things that i absolutely hate about the win32 stuff.
look into: WM_CTLCOLORSTATIC + SetBkMode()
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu May 20, 2010 11:45 am Post subject: |
|
|
Well, i've reached this situation
Code: |
case WM_CTLCOLORSTATIC:
if ((HWND)lParam == static_status) {
SetBkMode((HDC)wParam,OPAQUE);
}
|
but the background is still remains the same
_________________
Stylo |
|
Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Thu May 20, 2010 1:36 pm Post subject: |
|
|
Not sure, but doesn't lParam have a low/high word?
|
|
Back to top |
|
 |
Dami Master Cheater
Reputation: 0
Joined: 23 Oct 2006 Posts: 336
|
Posted: Thu May 20, 2010 2:25 pm Post subject: |
|
|
slovach wrote: | uggh, this is one of the things that i absolutely hate about the win32 stuff.
look into: WM_CTLCOLORSTATIC + SetBkMode() |
Thanks mate, that solved my problem.
And here i was spending time on looking at the styles if i had missed one part O.o
+1 for you.
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Thu May 20, 2010 3:15 pm Post subject: |
|
|
Stylo wrote: | Well, i've reached this situation
Code: |
case WM_CTLCOLORSTATIC:
if ((HWND)lParam == static_status) {
SetBkMode((HDC)wParam,OPAQUE);
}
|
but the background is still remains the same |
try TRANSPARENT instead.
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Fri May 21, 2010 12:54 am Post subject: |
|
|
slovach wrote: | Stylo wrote: | Well, i've reached this situation
Code: |
case WM_CTLCOLORSTATIC:
if ((HWND)lParam == static_status) {
SetBkMode((HDC)wParam,OPAQUE);
}
|
but the background is still remains the same |
try TRANSPARENT instead. |
Tried that already, didn't help.
Did you make it?
_________________
Stylo |
|
Back to top |
|
 |
|