Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: how do I change window background colors in Win32::GUI?

by dada (Chaplain)
on Feb 11, 2003 at 14:41 UTC ( #234406=note: print w/replies, xml ) Need Help??


in reply to how do I change window background colors in Win32::GUI?

well, from the MSDN documentation:

hbrBackground

Handle to the class background brush. This member can be a handle to the physical brush to be used for painting the background, or it can be a color value. A color value must be one of the following standard system colors (the value 1 must be added to the chosen color) {...} When this member is NULL, an application must paint its own background whenever it is requested to paint in its client area.
the last sentence explains the "kinda transparent" if you put a 0 (NULL) in.

the "standard system colors" are the following ones (taken from include\winuser.h):

#define COLOR_SCROLLBAR         0
#define COLOR_BACKGROUND        1
#define COLOR_ACTIVECAPTION     2
#define COLOR_INACTIVECAPTION   3
#define COLOR_MENU              4
#define COLOR_WINDOW            5
#define COLOR_WINDOWFRAME       6
#define COLOR_MENUTEXT          7
#define COLOR_WINDOWTEXT        8
#define COLOR_CAPTIONTEXT       9
#define COLOR_ACTIVEBORDER      10
#define COLOR_INACTIVEBORDER    11
#define COLOR_APPWORKSPACE      12
#define COLOR_HIGHLIGHT         13
#define COLOR_HIGHLIGHTTEXT     14
#define COLOR_BTNFACE           15
#define COLOR_BTNSHADOW         16
#define COLOR_GRAYTEXT          17
#define COLOR_BTNTEXT           18
so, for example, if you want your window's background to be COLOR_APPWORKSPACE, you have to pass -color => 13 (that's 12 + 1) to your Win32::GUI::Class.

the appearance of the colors is (should be? :-) documented by their own names. hope this helps...

cheers,
Aldo

King of Laziness, Wizard of Impatience, Lord of Hubris

  • Comment on Re: how do I change window background colors in Win32::GUI?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://234406]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2022-05-21 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?