I either need to determine if the LCD on a notebook has been closed or if the LCD has been turned off.
I've done a ton of research on this subject and I've determined that the latter of the two will be most likely obtainable.
I've asked this question many places and unable to get anything through those methods or plain research.
I did read about one question, where another guy was trying to obtain the same as me. One person suggested that the top level window receives a WM_SYSCOMMAND message with wParam set to SC_MONITORPOWER whenever the power status of a display is changing. But I'm afraid I'm not 100% sure how to work with that.
I tried using the WinProc method to determine if the message received was SC_MONITORPOWER, but that didn't work.
Then I saw a bit of code that allowed the user to turn the monitor on and off, but I don't think it can be used to determine the state.
I need this information badly, so if anyone can assist, I would really appreciate it.
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, _
ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Private Const SC_MONITORPOWER As Integer = &HF170
Private Const WM_SYSCOMMAND As Integer = &H112
Private Const MONITOR_ON As Integer = -1
Private Const MONITOR_OFF As Integer = 2
SendMessage(Me.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF)