网站首页  词典首页

请输入您要查询的函数:

 

术语 changedisplaysettings
释义 ChangeDisplaySettings
语法:
LONG ChangeDisplaySettings(
__in DEVMODE *lpDevMode,
__in DWORD dwflags
);
ChangeDisplaySettings函数
该ChangeDisplaySettings函数更改默认的显示设备的设置,以指定图形模式。
要更改指定的显示设备的设置,请使用ChangeDisplaySettingsEx功能。
参数
lpDevMode [in]
一个DEVMODE结构,描述了新的图形模式的指针。如果lpDevMode为NULL,所有目前在该注册表值将被用于显示设置。通过为lpDevMode参数和dwFlags参数0 NULL是最简单的方法后返回一个动态模式更改为默认模式。
dmSize的DEVMODE的成员必须被初始化的大小,以字节为单位的DEVMODE结构。 dmDriverExtra的DEVMODE的成员必须被初始化,以指示司机的私人数据的字节数后DEVMODE结构。此外,您可以使用任何或DEVMODE结构下面的所有成员。
MemberMeaning
dmBitsPerPelBits每像素
dmPelsWidthPixel宽度
dmPelsHeightPixel高度
dmDisplayFlagsMode旗
dmDisplayFrequencyMode频率
设备的dmPositionPosition在多显示器配置
除了利用一个或多个成员的DEVMODE前,您还必须设置一个或多个成员的dmFields下列值更改显示设置。
ValueMeaning
DM_BITSPERPELUse的dmBitsPerPel价值。
DM_PELSWIDTHUse的dmPelsWidth价值。
DM_PELSHEIGHTUse的dmPelsHeight价值。
DM_DISPLAYFLAGSUse的dmDisplayFlags价值。
DM_DISPLAYFREQUENCYUse的dmDisplayFrequency价值。
DM_POSITIONUse的dmPosition价值。
dwflags [in]
指示如何图形模式应该改变。此参数可以是下列值之一。
ValueMeaning
0The图形当前屏幕模式将被动态改变。
CDS_FULLSCREENThe模式是临时性的。
如果您更改并从另一个桌面,这种模式将不会重设。
CDS_GLOBALThe设定将保存在该地区的全局设置,使他们会影响计算机上的所有用户。否则只为用户设置被修改。此标志时才有效CDS_UPDATEREGISTRY并且与标志指定。
CDS_NORESETThe设置将被保存在注册表中,但不会生效。此标志时才有效CDS_UPDATEREGISTRY并且与标志指定。
CDS_RESETThe设置应该改变的,即使要求设置与当前设置相同。
CDS_SET_PRIMARYThis设备将成为主要的设备。
CDS_TESTThe系统如果被请求的图形模式可以设置的测试。
CDS_UPDATEREGISTRYThe图形当前屏幕模式将被动态地改变图形模式将在注册表更新。该模式的信息存储在用户配置文件。
指定CDS_TEST允许应用程序,以确定哪些图形模式真正有效,而不会导致系统转向了图形模式。
如果指定了CDS_UPDATEREGISTRY并且有可能改变图形模式动态,信息存储在注册表中和返回DISP_CHANGE_SUCCESSFUL。如果无法改变图形模式动态,信息存储在注册表中和返回DISP_CHANGE_RESTART。
如果指定了CDS_UPDATEREGISTRY并且信息不能存储在注册表中的图形模式不改变,DISP_CHANGE_NOTUPDATED返回。
返回值
在ChangeDisplaySettings函数下列值的回报之一。
ValueMeaning
DISP_CHANGE_SUCCESSFULThe设置更改是成功的。
DISP_CHANGE_BADDUALVIEWThe设置的改变是不成功的,因为系统是双屏幕显示功能的能力。
DISP_CHANGE_BADFLAGSAn标志的设置是无效的传入
DISP_CHANGE_BADMODEThe图形模式不支持。
DISP_CHANGE_BADPARAMAn无效的参数传递进来,这可以包括一个无效的旗帜或标志的组合。
DISP_CHANGE_FAILEDThe显示驱动程序未能指定图形模式。
DISP_CHANGE_NOTUPDATEDUnable设置写入注册表。
DISP_CHANGE_RESTARTThe必须重新启动计算机,以便在图形模式工作。
备注
为确保DEVMODE结构传递给ChangeDisplaySettings是有效的,只包含值的显示驱动程序的支持,使用由EnumDisplaySettings函数返回的DEVMODE的。
当显示模式动态改变的WM_DISPLAYCHANGE消息被发送到所有正在运行的以下信息参数应用。
ParametersMeaning
位每像素wParamNew
LOWORD(lparam的)新像素宽度
HIWORD(lparam的)新像素高度
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinuser.h(头文件:winuser.h)
LibraryUser32.lib
DLLUser32.dll
Unicode和ANSI namesChangeDisplaySettingsW(Unicode)和ChangeDisplaySettingsA(ANSI)的
参见
设备上下文概述
设备上下文函数
ChangeDisplaySettingsEx
CreateDC
的DEVMODE
EnumDisplayDevices
EnumDisplaySettings
WM_DISPLAYCHANGE
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==ChangeDisplaySettings Function
The ChangeDisplaySettings function changes the settings of the default display device to the specified graphics mode.
To change the settings of a specified display device, use the ChangeDisplaySettingsEx function.
Syntax
LONG ChangeDisplaySettings(
__in DEVMODE *lpDevMode,
__in DWORD dwflags
);
Parameters
lpDevMode [in]
A pointer to a DEVMODE structure that describes the new graphics mode. If lpDevMode is NULL, all the values currently in the registry will be used for the display setting. Passing NULL for the lpDevMode parameter and 0 for the dwFlags parameter is the easiest way to return to the default mode after a dynamic mode change.
The dmSize member of DEVMODE must be initialized to the size, in bytes, of the DEVMODE structure. The dmDriverExtra member of DEVMODE must be initialized to indicate the number of bytes of private driver data following the DEVMODE structure. In addition, you can use any or all of the following members of the DEVMODE structure.
MemberMeaning
dmBitsPerPelBits per pixel
dmPelsWidthPixel width
dmPelsHeightPixel height
dmDisplayFlagsMode flags
dmDisplayFrequencyMode frequency
dmPositionPosition of the device in a multimonitor configuration

In addition to using one or more of the preceding DEVMODE members, you must also set one or more of the following values in the dmFields member to change the display setting.
ValueMeaning
DM_BITSPERPELUse the dmBitsPerPel value.
DM_PELSWIDTHUse the dmPelsWidth value.
DM_PELSHEIGHTUse the dmPelsHeight value.
DM_DISPLAYFLAGSUse the dmDisplayFlags value.
DM_DISPLAYFREQUENCYUse the dmDisplayFrequency value.
DM_POSITIONUse the dmPosition value.

dwflags [in]
Indicates how the graphics mode should be changed. This parameter can be one of the following values.
ValueMeaning
0The graphics mode for the current screen will be changed dynamically.
CDS_FULLSCREENThe mode is temporary in nature.
If you change to and from another desktop, this mode will not be reset.
CDS_GLOBALThe settings will be saved in the global settings area so that they will affect all users on the machine. Otherwise, only the settings for the user are modified. This flag is only valid when specified with the CDS_UPDATEREGISTRY flag.
CDS_NORESETThe settings will be saved in the registry, but will not take effect. This flag is only valid when specified with the CDS_UPDATEREGISTRY flag.
CDS_RESETThe settings should be changed, even if the requested settings are the same as the current settings.
CDS_SET_PRIMARYThis device will become the primary device.
CDS_TESTThe system tests if the requested graphics mode could be set.
CDS_UPDATEREGISTRYThe graphics mode for the current screen will be changed dynamically and the graphics mode will be updated in the registry. The mode information is stored in the USER profile.

Specifying CDS_TEST allows an application to determine which graphics modes are actually valid, without causing the system to change to that graphics mode.
If CDS_UPDATEREGISTRY is specified and it is possible to change the graphics mode dynamically, the information is stored in the registry and DISP_CHANGE_SUCCESSFUL is returned. If it is not possible to change the graphics mode dynamically, the information is stored in the registry and DISP_CHANGE_RESTART is returned.
If CDS_UPDATEREGISTRY is specified and the information could not be stored in the registry, the graphics mode is not changed and DISP_CHANGE_NOTUPDATED is returned.
Return Value
The ChangeDisplaySettings function returns one of the following values.
ValueMeaning
DISP_CHANGE_SUCCESSFULThe settings change was successful.
DISP_CHANGE_BADDUALVIEWThe settings change was unsuccessful because system is DualView capable.
DISP_CHANGE_BADFLAGSAn invalid set of flags was passed in.
DISP_CHANGE_BADMODEThe graphics mode is not supported.
DISP_CHANGE_BADPARAMAn invalid parameter was passed in. This can include an invalid flag or combination of flags.
DISP_CHANGE_FAILEDThe display driver failed the specified graphics mode.
DISP_CHANGE_NOTUPDATEDUnable to write settings to the registry.
DISP_CHANGE_RESTARTThe computer must be restarted in order for the graphics mode to work.

Remarks
To ensure that the DEVMODE structure passed to ChangeDisplaySettings is valid and contains only values supported by the display driver, use the DEVMODE returned by the EnumDisplaySettings function.
When the display mode is changed dynamically, the WM_DISPLAYCHANGE message is sent to all running applications with the following message parameters.
ParametersMeaning
wParamNew bits per pixel
LOWORD(lParam)New pixel width
HIWORD(lParam)New pixel height

Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinuser.h (include Windows.h)
LibraryUser32.lib
DLLUser32.dll
Unicode and ANSI namesChangeDisplaySettingsW (Unicode) and ChangeDisplaySettingsA (ANSI)
See Also
Device Contexts Overview
Device Context Functions
ChangeDisplaySettingsEx
CreateDC
DEVMODE
EnumDisplayDevices
EnumDisplaySettings
WM_DISPLAYCHANGE
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd183411(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 更新时间:2025/1/23 7:49:26