Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Harnessing Windows Colors
Message
 
To
22/05/2002 09:19:09
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00659862
Message ID:
00659916
Views:
38
This message has been marked as the solution to the initial question of the thread.
Darrell,

>I have a question about using the Windows colors on a form. The goal is to highlight a tab on the page when that page has focus, and the other tabs are 'grayed out.' For this, I wanted to use the active window and inactive window system colors. Is there any way to grab those colors from windows to use as the backcolor?

See code below!

Regards,
Armin
*--------------------------
*-- GetSysColor Win-API Constants
*--------------------------

#DEFINE CTLCOLOR_MSGBOX         0
#DEFINE CTLCOLOR_EDIT           1
#DEFINE CTLCOLOR_LISTBOX        2
#DEFINE CTLCOLOR_BTN            3
#DEFINE CTLCOLOR_DLG            4
#DEFINE CTLCOLOR_SCROLLBAR      5
#DEFINE CTLCOLOR_STATIC         6
#DEFINE CTLCOLOR_MAX            7

#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
#DEFINE COLOR_INACTIVECAPTIONTEXT 19
#DEFINE COLOR_BTNHIGHLIGHT      20

#DEFINE COLOR_3DDKSHADOW        21
#DEFINE COLOR_3DLIGHT           22

*-- ToolTips
#DEFINE COLOR_INFOTEXT          23	&& Text
#DEFINE COLOR_INFOBK            24	&& Background

#DEFINE COLOR_HOTLIGHT                  26
#DEFINE COLOR_GRADIENTACTIVECAPTION     27
#DEFINE COLOR_GRADIENTINACTIVECAPTION   28

#DEFINE COLOR_DESKTOP           COLOR_BACKGROUND
#DEFINE COLOR_3DFACE            COLOR_BTNFACE
#DEFINE COLOR_3DSHADOW          COLOR_BTNSHADOW
#DEFINE COLOR_3DHIGHLIGHT       COLOR_BTNHIGHLIGHT
#DEFINE COLOR_3DHILIGHT         COLOR_BTNHIGHLIGHT
#DEFINE COLOR_BTNHILIGHT        COLOR_BTNHIGHLIGHT


DECLARE INTEGER GetSysColor IN WIN32API ;
	INTEGER nElement

? GetSysColor(AnyOfTheConstantsAbove)

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform