471,354 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Blank Screen after resume

Hi,

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
  1. Public Structure POINTAPI
  2. Dim x As Integer
  3. Dim y As Integer
  4. End Structure
  5. Private Declare Function GetCursorPos Lib "user32" (ByRef lpPoint As POINTAPI) As Integer
  6. Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
  7.  
  8. Dim Pt As New POINTAPI
  9. GetCursorPos(Pt)
  10. SetCursorPos(Pt.x, Pt.y)
This didn't work.
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>
Jul 21 '05 #1
0 963

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Tom | last post: by
reply views Thread by Stefan via .NET 247 | last post: by
2 posts views Thread by Parasyke | last post: by
2 posts views Thread by Eric | last post: by
1 post views Thread by Raul Elms | last post: by
1 post views Thread by dr1ft3r | last post: by
1 post views Thread by Rajtomar | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.