How to turn off the monitor in visual basic on windows XP ?
i mean , putting it in stanby , so it will turn on again with a click or key press.
i got this code at www.planetsourcecode.com
, but it doesn't seem to work on XP :
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MONITORPOWER = &HF170
'Turn Monitor on: ->
SendMessage Me.hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal 0&
'Turn Monitor off: ->
SendMessage Me.hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal -1&