Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[VB.NET]Turn monitor/screen off[SRC]

Code
Const ScreenOn = -1&
    Const ScreenOff = 2&
    Const SC_MONITORPOWER = &HF170&
    Const WM_SYSCOMMAND = &H112

    Declare Auto Function SendMessage Lib "user32" ( _
    ByVal hWnd As IntPtr, _
    ByVal Msg As Integer, _
    ByVal wParam As Integer, _
    ByVal lParam As Integer) As Integer

    Function SetScreen(Optional ByVal bln As Boolean = True) As Integer
        SetScreen = SendMessage(Handle, WM_SYSCOMMAND, SC_MONITORPOWER, IIf(bln, ScreenOn, ScreenOff))
    End Function
Put the above in your code then you can use this
Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SetScreen(False)
    End Sub
to call the function.
You could use your code after a 4 second delay of running this code
https://hackforums.net/showthread.php?tid=422248


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by [ ZERO ]Nov 7, 2017 09:35 PM 13 2,439 Nov 7, 2017 09:35 PM
Last Post: NinjaLeaks
[.NET] by BinaryFoxMar 22, 2017 04:38 PM 7 332 Mar 22, 2017 04:38 PM
Last Post: SIM-1847363
[C#] by EtherealMay 18, 2016 09:26 AM 22 3,601 May 18, 2016 09:26 AM
Last Post: 6e756c6c