 |
 |
 |
|
|  |  |
 |
EnumDisplayDevices ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
The EnumDisplayDevices function lets you obtain information about the display devices in a system. |
 |  | | Code examples: |  | |
|
 |  | | Declaration: |  |  |
BOOL EnumDisplayDevices(
LPCTSTR lpDevice, // device name
DWORD iDevNum, // display device
PDISPLAY_DEVICE lpDisplayDevice, // device information
DWORD dwFlags // reserved
);
|
 |  |  | | FoxPro declaration: |  |  |
DECLARE INTEGER EnumDisplayDevices IN user32;
STRING lpDevice,;
INTEGER iDevNum,;
STRING @ lpDisplayDevice,;
INTEGER dwFlags
|
 |  |  | | Parameters: |  | lpDevice
[in] Pointer to the device name. If NULL, function returns information for the display adapter(s) on the machine, based on iDevNum.
iDevNum
[in] Index value that specifies the display device of interest.
lpDisplayDevice
[out] Pointer to a DISPLAY_DEVICE structure that receives information about the display device specified by iDevNum.
dwFlags
This parameter is currently not used and should be set to zero. |
 |  | | Return value: |  | | If the function succeeds, the return value is nonzero. |
 |  | | Usage: |  |
nIndex = 0 && start with 0
DO WHILE .T.
IF EnumDisplayDevices(NULL, nIndex, @cBuffer, 0) = 0
* the enumeration ended or failed
RETURN ""
ENDIF
nFlags = buf2word(SUBSTR(cBuffer, 165,2))
IF BitAnd(nFlags, 4) = 4 && primary device
cResult= SUBSTR(cBuffer, 5,32)
RETURN SUBSTR(cResult, 1,AT(Chr(0),cResult)-1)
ENDIF
nIndex = nIndex + 1
ENDDO
|
 |  | | My comment: |  | To query all display devices in the system, call this function in a loop, starting with iDevNum set to 0, and incrementing iDevNum until the function fails.
To get information on the display adapter, call EnumDisplayDevices with lpDevice set to NULL. Then DISPLAY_DEVICE.DeviceString contains the adapter name.
To obtain information on a display monitor, first call EnumDisplayDevices with lpDevice set to NULL. Then call EnumDisplayDevices with lpDevice set to DISPLAY_DEVICE.DeviceName from the first call to EnumDisplayDevices and with iDevNum set to zero. Then DISPLAY_DEVICE.DeviceString is the monitor name.
See also MonitorFromWindow, GetMonitorInfo, EnumDisplaySettings functions. |
 |  | | Word Index links for the EnumDisplayDevices : |  | |
|
 |  | | Translate this page: |  | |  |  | | • |  | | Created: | 2003-01-21 11:19:27 | | Modified: | 2007-06-11 22:05:55 | Visited in last 7 days: 35 |
|
 |
 |
 |
 |
Copyright © 2001-2013
News2News, Inc.
Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use.
The information on this page is presented AS IS, meaning that you may use it at your own risk.
Microsoft Visual FoxPro
and Windows are trade marks
of Microsoft Corp.
All other trademarks are the property of their respective owners.
Privacy policy
|
 |
 |
 |
Credits: PHP (4.4.9), an HTML-embedded scripting language,
MySQL (5.1.55-log), the Open Source standard SQL database,
AceHTML Freeware
Version 4, freeware HTML Editor of choice. Hosted by Korax Online Inc. |
 |
 |
|
 |
 |
|
|