I have stuck at one place where I have to turn off the monitor and at background all my processes should work something like turn off the monitor only but cpu etc should work normally. Actually, my backend sends screenoFF command and accordingly I send a "SendMessage" command to off the monitor it is working fine on my laptop, but in production side system is going into sleep mode. I would appreciate If anyone could help here thanks.
Private Const WM_SYSCOMMAND As Integer = &H112
Private Const SC_MONITORPOWER As Integer = &HF170
<DllImport("user32.dll")>
Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal hMsg As Integer,
ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
End Function
SendMessage(Me.Handle, WM_SYSCOMMAND, CType(SC_MONITORPOWER, IntPtr), CType(2, IntPtr))