We need a library that:
1. Works on Win2k/XP. (Support for NT4 and 9x/Me is optional.)
2. Has three exported functions:
Returns a DWORD value containing a bit mask that describes which DPMS states the primary monitor supports. The typical states are: On, Standby, Suspend, Off, Reduced Power.
Returns the DPMS status of the display on the primary monitor.
Sets the DPMS status on the primary monitor to one of the supported states.
3. Important! Potential user input (mouse movements, etc) should not cause the OS to reset the DPMS status to On. (The obvious WM_SYSCOMMAND wParam = SC_MONITORPOWER call, while sets the DPMS status to the value of lParam has this problem.) The DPMS status set using the library must remain the same until the library is used to change it. Obvious exceptions from this rule can be accepted only if the OS interferes with the DPMS status when changing the video mode, putting the display into low-power mode due to user inactivity, etc.
From DOS, one could just issue an int 10h with AX=4f10h, and BL being 0, 1 or 2 for one of the above three functions. This obviously does not work in NT/2K/XP.
In NT4, you can call VideoPortInt10 from a kernel driver to achieve the goal. Unfortunately VideoPortInt10 calls in 2K/XP are restricted to video miniport drivers, and cause a bluescreen if called from a plain kernel driver.
One could think of sending IOCTL_VIDEO_SET_POWER_MANAGEMENT and similar calls to \\??\\DISPLAY1 or \Device\Video0, but the problem with this is that these devices are opened exclusively by the system and trying to call CreateFile() from user mode or ZwCreateFile() from kernel mode will fail with Access Denied.
We realize and accept the fact that solving this problem will probably require the use of undocumented features such as somehow duplicating the handle the system has opened on \\??\\DISPLAY1, or other nonorthodox methods.
1) Complete and fully-functional library and a test/demo program in executable form as well as complete source code of all work done.
4) Complete ownership and distribution copyrights to all work purchased.
Required support for:
Windows 2003 Server
Would like to optionallys support: