hey there!
im trying to turn off my monitor using api, lots of vb6 examples found here.
i tried to convert it to vb.NET, but it doesnt seem to work.
please check it out and tell me if u got a clue
and yes, i DO know i am not good at translating vb6 to vb.netVB Code:
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" _ (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32 ' Public Sub turnoffmonitor() Const HWND_BROADCAST As Int32 = &HFFFFI Const WM_SYSCOMMAND As Int32 = &H112 Const SC_MONITORPOWER As Int32 = &HF170 SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 0&) End Sub![]()



Reply With Quote