Is it possible to know the current state of the display - enabled or disabled ?
FWH 17.04/xHarbour BCC7
Is it possible to know the current state of the display - enabled or disabled ?
FWH 17.04/xHarbour BCC7
Antonio, thanks for your help !
The GetDevicePowerState function takes two parameters. The first parameter is a handle monitor. And how to find it ?
#include "FiveWin.ch"
#define MONITOR_DEFAULTTOPRIMARY 1
function Main()
local bResult
GetDevicePowerState( MonitorFromWindow( FindWindow( 0, 0 ), MONITOR_DEFAULTTOPRIMARY ), @bResult )
return nil
DLL32 Function GetDevicePowerState(hDevice AS DWORD, @bResult AS BOOL) AS BOOL PASCAL FROM "GetDevicePowerState" LIB "kernel32.dll"
DLL32 Function MonitorFromWindow(hDevice AS LONG, pr AS DWORD) AS BOOL PASCAL FROM "GetDevicePowerState" LIB "user32.dll"Еhank you, corrected. Now the function GetDevicePowerState returns .F. in any case. And when the display is on and when I turn it off by
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2)