网站首页  词典首页

请输入您要查询的函数:

 

术语 getsyscolor
释义 GetSysColor
语法:
C++
DWORD WINAPI GetSysColor(
__in int nIndex
);
GetSysColor函数
检索指定的元素显示当前颜色。显示内容是一个窗口部件,显示器上显示系统的显示屏幕。
参数
nIndex [in]
显示元素,其颜色是要检索。此参数可以是下列值之一。
ValueMeaning
COLOR_3DDKSHADOW
21Dark阴影三维显示元素。
COLOR_3DFACE
15Face彩色三维显示元素和对话框的背景。
COLOR_3DHIGHLIGHT
20Highlight彩色三维(为边缘面对光源显示元素。)
COLOR_3DHILIGHT
20Highlight彩色三维(为边缘面对光源显示元素。)
COLOR_3DLIGHT
22Light彩色三维(为边缘面对光源显示元素。)
COLOR_3DSHADOW
16Shadow彩色三维(面临的边缘远离光源)显示元素。
COLOR_ACTIVEBORDER
10Active窗口边框。
COLOR_ACTIVECAPTION
2Active窗口的标题栏。
指定在一个活动窗口的标题栏左侧的颜色渐变色的渐变效果,如果启用。
COLOR_APPWORKSPACE
12Background多文档界面的颜色(MDI)应用程序。
COLOR_BACKGROUND
1Desktop。
COLOR_BTNFACE
15Face彩色三维显示元素和对话框的背景。
COLOR_BTNHIGHLIGHT
20Highlight彩色三维(为边缘面对光源显示元素。)
COLOR_BTNHILIGHT
20Highlight彩色三维(为边缘面对光源显示元素。)
COLOR_BTNSHADOW
16Shadow彩色三维(面临的边缘远离光源)显示元素。
COLOR_BTNTEXT
18Text的按键。
COLOR_CAPTIONTEXT
在标题9Text,大小方块,箭头滚动条框。
COLOR_DESKTOP
1Desktop。
COLOR_GRADIENTACTIVECAPTION
27Right在一个活动窗口的标题栏颜色渐变方的颜色。 COLOR_ACTIVECAPTION指定左边的颜色。与使用SystemParametersInfo函数使用SPI_GETGRADIENTCAPTIONS,以确定是否启用渐变效果。
COLOR_GRADIENTINACTIVECAPTION
28Right在一个非活动窗口的标题栏颜色渐变方的颜色。 COLOR_INACTIVECAPTION指定左边的颜色。
COLOR_GRAYTEXT
17Grayed(禁用)文本。这颜色设置为0,如果当前的显示驱动程序不支持了坚实的灰色。
COLOR_HIGHLIGHT
13Item(拧)选择在一个控制。
COLOR_HIGHLIGHTTEXT
项目14Text(拧)选择在一个控制。
COLOR_HOTLIGHT
26Color超链接或热跟踪项目。
COLOR_INACTIVEBORDER
11Inactive窗口边框。
COLOR_INACTIVECAPTION
3Inactive窗口的标题。
指定的不活动窗口的标题栏左侧的颜色渐变色的渐变效果,如果启用。
COLOR_INACTIVECAPTIONTEXT
文本19Color处于非活动的标题。
COLOR_INFOBK
24Background颜色提示控制。
COLOR_INFOTEXT
23Text颜色提示控制。
COLOR_MENU
4Menu背景。
COLOR_MENUHILIGHT
29The使用的颜色突出菜单项菜单时以固定菜单出现(见SystemParametersInfo)。突出显示的菜单项概述了COLOR_HIGHLIGHT。
Windows 2000中:此值不支持。
COLOR_MENUBAR
第三十为菜单栏的背景颜色时,菜单显示为单位菜单(见SystemParametersInfo)。然而,COLOR_MENU继续指定弹出菜单的背景颜色。
Windows 2000中:此值不支持。
COLOR_MENUTEXT
7Text在菜单。
COLOR_SCROLLBAR
0Scroll酒吧灰色地带。
COLOR_WINDOW
5Window背景。
COLOR_WINDOWFRAME
6Window框架。
COLOR_WINDOWTEXT
8Text的窗口。
返回值
该函数返回的红,绿,蓝(给定的元素RGB)颜色值。
如果nIndex参数超出范围,返回值是零。因为零也是一个有效的RGB值,您不能使用GetSysColor,以确定是否系统颜色是由当前平台的支持。相反,使用GetSysColorBrush函数,它返回NULL,如果不支持的颜色。
备注
要显示的RGB值组件,请使用GetRValue,GetGValue和GetBValue宏。
单色显示器系统的颜色,通常解释为灰色阴影。
画一个系统颜色刷子,应用程序应该使用GetSysColorBrush(nIndex),而不是CreateSolidBrush(GetSysColor(nIndex)),因为GetSysColorBrush返回而不是分配一个新的缓存刷。
颜色是最重要的用户界面的视觉元素。有关使用颜色在您的应用指南,看到颜色。
实例
有关示例,请参阅更改窗口元素的颜色。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinuser.h(头文件:winuser.h)
LibraryUser32.lib
DLLUser32.dll
参见
CreateSolidBrush
GetSysColorBrush
SetSysColors
系统信息功能
SystemParametersInfo
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetSysColor Function
Retrieves the current color of the specified display element. Display elements are the parts of a window and the display that appear on the system display screen.
Syntax
C++
DWORD WINAPI GetSysColor(
__in int nIndex
);
Parameters
nIndex [in]
The display element whose color is to be retrieved. This parameter can be one of the following values.
ValueMeaning
COLOR_3DDKSHADOW
21Dark shadow for three-dimensional display elements.
COLOR_3DFACE
15Face color for three-dimensional display elements and for dialog box backgrounds.
COLOR_3DHIGHLIGHT
20Highlight color for three-dimensional display elements (for edges facing the light source.)
COLOR_3DHILIGHT
20Highlight color for three-dimensional display elements (for edges facing the light source.)
COLOR_3DLIGHT
22Light color for three-dimensional display elements (for edges facing the light source.)
COLOR_3DSHADOW
16Shadow color for three-dimensional display elements (for edges facing away from the light source).
COLOR_ACTIVEBORDER
10Active window border.
COLOR_ACTIVECAPTION
2Active window title bar.
Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled.
COLOR_APPWORKSPACE
12Background color of multiple document interface (MDI) applications.
COLOR_BACKGROUND
1Desktop.
COLOR_BTNFACE
15Face color for three-dimensional display elements and for dialog box backgrounds.
COLOR_BTNHIGHLIGHT
20Highlight color for three-dimensional display elements (for edges facing the light source.)
COLOR_BTNHILIGHT
20Highlight color for three-dimensional display elements (for edges facing the light source.)
COLOR_BTNSHADOW
16Shadow color for three-dimensional display elements (for edges facing away from the light source).
COLOR_BTNTEXT
18Text on push buttons.
COLOR_CAPTIONTEXT
9Text in caption, size box, and scroll bar arrow box.
COLOR_DESKTOP
1Desktop.
COLOR_GRADIENTACTIVECAPTION
27Right side color in the color gradient of an active window's title bar. COLOR_ACTIVECAPTION specifies the left side color. Use SPI_GETGRADIENTCAPTIONS with the SystemParametersInfo function to determine whether the gradient effect is enabled.
COLOR_GRADIENTINACTIVECAPTION
28Right side color in the color gradient of an inactive window's title bar. COLOR_INACTIVECAPTION specifies the left side color.
COLOR_GRAYTEXT
17Grayed (disabled) text. This color is set to 0 if the current display driver does not support a solid gray color.
COLOR_HIGHLIGHT
13Item(s) selected in a control.
COLOR_HIGHLIGHTTEXT
14Text of item(s) selected in a control.
COLOR_HOTLIGHT
26Color for a hyperlink or hot-tracked item.
COLOR_INACTIVEBORDER
11Inactive window border.
COLOR_INACTIVECAPTION
3Inactive window caption.
Specifies the left side color in the color gradient of an inactive window's title bar if the gradient effect is enabled.
COLOR_INACTIVECAPTIONTEXT
19Color of text in an inactive caption.
COLOR_INFOBK
24Background color for tooltip controls.
COLOR_INFOTEXT
23Text color for tooltip controls.
COLOR_MENU
4Menu background.
COLOR_MENUHILIGHT
29The color used to highlight menu items when the menu appears as a flat menu (see SystemParametersInfo ). The highlighted menu item is outlined with COLOR_HIGHLIGHT.
Windows 2000: This value is not supported.
COLOR_MENUBAR
30The background color for the menu bar when menus appear as flat menus (see SystemParametersInfo ). However, COLOR_MENU continues to specify the background color of the menu popup.
Windows 2000: This value is not supported.
COLOR_MENUTEXT
7Text in menus.
COLOR_SCROLLBAR
0Scroll bar gray area.
COLOR_WINDOW
5Window background.
COLOR_WINDOWFRAME
6Window frame.
COLOR_WINDOWTEXT
8Text in windows.

Return Value
The function returns the red, green, blue (RGB) color value of the given element.
If the nIndex parameter is out of range, the return value is zero. Because zero is also a valid RGB value, you cannot use GetSysColor to determine whether a system color is supported by the current platform. Instead, use the GetSysColorBrush function, which returns NULL if the color is not supported.
Remarks
To display the component of the RGB value, use the GetRValue , GetGValue , and GetBValue macros.
System colors for monochrome displays are usually interpreted as shades of gray.
To paint with a system color brush, an application should use GetSysColorBrush(nIndex), instead of CreateSolidBrush(GetSysColor(nIndex)), because GetSysColorBrush returns a cached brush, instead of allocating a new one.
Color is an important visual element of most user interfaces. For guidelines about using color in your applications, see Color .
Examples
For an example, see Changing the Colors of Window Elements .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinuser.h (include Windows.h)
LibraryUser32.lib
DLLUser32.dll
See Also
CreateSolidBrush
GetSysColorBrush
SetSysColors
System Information Functions
SystemParametersInfo
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724371(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:23:53