I do have the following issue.
I put the pc into standby mode (s3) and the windows xp taskscheduler wakes my computer up again.
But the monitor still stays blank as long as I don't move my mouse.
So I thought that I could get the screen back when I use this code:
Expand|Select|Wrap|Line Numbers
- Public Structure POINTAPI
- Dim x As Integer
- Dim y As Integer
- End Structure
- Private Declare Function GetCursorPos Lib "user32" (ByRef lpPoint As POINTAPI) As Integer
- Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
- Dim Pt As New POINTAPI
- GetCursorPos(Pt)
- SetCursorPos(Pt.x, Pt.y)
I also tried SendMessage/PostMessage. This didn't work either.
<System.Runtime.InteropServices.DllImport("user32. DLL")> _
Private Shared Function SendMessage( _
ByVal hWnd As Integer, ByVal wMsg As Integer, _
ByVal wParam As Integer, ByVal lParam As Integer _
) As Integer
End Function
<System.Runtime.InteropServices.DllImport("user32. dll")> _
Private Shared Function GetForegroundWindow() As System.IntPtr
End Function
<STAThread()> _
Private Sub MonitorOn()
Const MONITOR_ON As Integer = -1
Const MONITOR_OFF As Integer = 2
Const WM_SYSCOMMAND As Integer = 274
Const SC_MONITORPOWER As Integer = 61808
Const HWND_TOPMOST As Integer = -1
System.Threading.Thread.Sleep(5000)
SendMessage(GetForegroundWindow, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_ON)
End Sub
Does anybody know a solution?
Thanks!
--------------------------------
From: Stefan
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>RNkTY4YrHEuoaNFHC0zI6Q==</Id>