WINCE下使用EnumDisplaySettings获取LCD属性

 

来自WINCE的MSDN手册

 

 

This function retrieves information about one of the graphics modes for a display device. To retrieve information for all the graphics modes of a display device, make a series of calls to this function.

BOOL EnumDisplaySettings(
  LPCTSTR lpszDeviceName,
  DWORD iModeNum,
  LPDEVMODE lpDevMode
);
Parameters
lpszDeviceName
[in] Pointer to a null-terminated string that specifies the display device.

This parameter is either NULL or a DISPLAY_DEVICE.DeviceName returned fromEnumDisplayDevices.

A NULL value specifies the current display device on the system that is running the calling thread.

iModeNum
[in] Specifies the type of information to retrieve.

This value can be a graphics mode index or one of values shown in the following table.

ValueDescription
ENUM_CURRENT_SETTINGSRetrieve the current settings for the display device.
ENUM_REGISTRY_SETTINGSRetrieve the settings for the display devices that are currently stored in the registry.

For more information, see Remarks.

lpDevMode
[out] Pointer to a DEVMODE structure that will contain the information about the specified graphics mode.

Before calling EnumDisplaySettings, set the dmSize member tosizeof(DEVMODE), and set the dmDriverExtra member to indicate the size, in bytes, of the additional space available to receive private driver data.

The EnumDisplaySettings function sets values for the followingDEVMODE members:

  • dmBitsPerPel
  • dmPelsWidth
  • dmPelsHeight
  • dmDisplayFlags
  • dmDisplayFrequency

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

To get extended error information, call GetLastError.

Remarks

The function fails if iModeNum is greater than the index of the display device's last graphics mode.

You can use iModeNum to enumerate all of a display device's graphics modes.

Graphics mode indexes start at zero.

To obtain information for all of a display device's graphics modes, make a series of calls toEnumDisplaySettings. To do this, set iModeNum to zero for the first call and then incrementiModeNum by one for each subsequent call. Continue calling the function until the return value is zero.

When you call EnumDisplaySettings with iModeNum set to zero, the operating system initializes and caches information about the display device.

When you call EnumDisplaySettings with iModeNum set to a nonzero value, the function returns the information that was cached the last time the function was called withiModeNum set to zero.

Requirements

OS Versions: Windows CE .NET 4.2 and later.
Header: Windows.h.
Link Library: Coredll.lib.

See Also

ChangeDisplaySettingsEx | CreateDC | DEVMODE | DISPLAY_DEVICE | EnumDisplayDevices |GDI Functions


© 2005 Microsoft Corporation. All rights reserved.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值