网站首页  词典首页

请输入您要查询的函数:

 

术语 setsystempaletteuse
释义 SetSystemPaletteUse
语法:
UINT SetSystemPaletteUse(
__in HDC hdc,
__in UINT uUsage
);
SetSystemPaletteUse功能
该SetSystemPaletteUse函数允许应用程序来指定系统调色板包含2个或20个固定的颜色。默认的系统调色板包含20个固定的颜色。 (静态颜色不能改变的当一个应用程序实现了逻辑调色板。)
参数
hdc [in]
一个句柄,设备上下文。此设备方面,必须提到的设备支持调色板。
uUsage [in]
该系统调色板的新用途。此参数可以是下列值之一。
ValueMeaning
SYSPAL_NOSTATICThe系统调色板包含两个静态颜色(黑色和白色)。
SYSPAL_NOSTATIC256The系统调色板不包含静态颜色。
SYSPAL_STATICThe系统调色板包含静态的颜色,也不会改变当一个应用程序实现其逻辑调色板。
返回值
如果函数成功,返回值是以前的系统调色板。它可以是SYSPAL_NOSTATIC,SYSPAL_NOSTATIC256,或SYSPAL_STATIC。
如果函数失败,返回值是SYSPAL_ERROR。
备注
应用程序可以判断设备是否支持通过调用GetDeviceCaps函数并指定RASTERCAPS不断调色板行动。
当一个应用程序窗口移到前台和SYSPAL_NOSTATIC值设置,应用程序必须调用GetSysColor函数保存当前系统的颜色设置。安理会还必须要求SetSysColors设置合理的值只使用黑色和白色。当应用程序返回的背景或终止时,以前的系统颜色必须得到恢复。
如果该函数返回SYSPAL_ERROR,在指定的设备上下文是无效的或不支持调色板。
应用程序必须调用只有当其窗口最大化,并具有输入焦点的功能。
如果一个应用程序调用设置为SYSPAL_NOSTATIC uUsage SetSystemPaletteUse,该系统将继续拨出的纯白色和纯黑色,分别系统调色板两个项目。
在调用设置为SYSPAL_NOSTATIC uUsage这项功能,应用程序必须采取以下步骤:
实现逻辑调色板。
调用GetSysColor函数保存当前系统的颜色设置。
调用SetSysColors函数来设置系统颜色使用合理价值黑色和白色。例如,相邻或重叠的项目(如窗框和边界)应设置为黑色和白色,分别为。
WM_SYSCOLORCHANGE消息发送到其他的顶层窗口,让他们用新的系统颜色重绘。
当应用程序的窗口失去焦点或关闭,应用程序必须执行以下步骤:
呼叫SetSystemPaletteUse设置为SYSPAL_STATIC的uUsage参数。
实现逻辑调色板。
系统颜色还原为原来的值。
发送WM_SYSCOLORCHANGE消息。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
颜色概述
颜色函数
GetDeviceCaps
GetSysColor
SetSysColors
GetSystemPaletteUse
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==SetSystemPaletteUse Function
The SetSystemPaletteUse function allows an application to specify whether the system palette contains 2 or 20 static colors. The default system palette contains 20 static colors. (Static colors cannot be changed when an application realizes a logical palette.)
Syntax
UINT SetSystemPaletteUse(
__in HDC hdc,
__in UINT uUsage
);
Parameters
hdc [in]
A handle to the device context. This device context must refer to a device that supports color palettes.
uUsage [in]
The new use of the system palette. This parameter can be one of the following values.
ValueMeaning
SYSPAL_NOSTATICThe system palette contains two static colors (black and white).
SYSPAL_NOSTATIC256The system palette contains no static colors.
SYSPAL_STATICThe system palette contains static colors that will not change when an application realizes its logical palette.

Return Value
If the function succeeds, the return value is the previous system palette. It can be either SYSPAL_NOSTATIC, SYSPAL_NOSTATIC256, or SYSPAL_STATIC.
If the function fails, the return value is SYSPAL_ERROR.
Remarks
An application can determine whether a device supports palette operations by calling the GetDeviceCaps function and specifying the RASTERCAPS constant.
When an application window moves to the foreground and the SYSPAL_NOSTATIC value is set, the application must call the GetSysColor function to save the current system colors setting. It must also call SetSysColors to set reasonable values using only black and white. When the application returns to the background or terminates, the previous system colors must be restored.
If the function returns SYSPAL_ERROR, the specified device context is invalid or does not support color palettes.
An application must call this function only when its window is maximized and has the input focus.
If an application calls SetSystemPaletteUse with uUsage set to SYSPAL_NOSTATIC, the system continues to set aside two entries in the system palette for pure white and pure black, respectively.
After calling this function with uUsage set to SYSPAL_NOSTATIC, an application must take the following steps:
Realize the logical palette.
Call the GetSysColor function to save the current system-color settings.
Call the SetSysColors function to set the system colors to reasonable values using black and white. For example, adjacent or overlapping items (such as window frames and borders) should be set to black and white, respectively.
Send the WM_SYSCOLORCHANGE message to other top-level windows to allow them to be redrawn with the new system colors.
When the application's window loses focus or closes, the application must perform the following steps:
Call SetSystemPaletteUse with the uUsage parameter set to SYSPAL_STATIC.
Realize the logical palette.
Restore the system colors to their previous values.
Send the WM_SYSCOLORCHANGE message.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Colors Overview
Color Functions
GetDeviceCaps
GetSysColor
SetSysColors
GetSystemPaletteUse
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd145090(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:19:59