Visual Basic 6 function "windows_reboot"

Go back

Below you'll find the source for the Visual Basic 6 function windows_reboot.

Attribute VB_Name = "modWindowsReboot"
' This function is downloaded from:
' You may freely distribute this file but please leave all comments, including this one, in it.
' @Author Stefan Thoolen <>

Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwReserved As Long, ByVal uReturnCode As Long) As Long

Private Const EWX_REBOOT = 2

' Reboots Windows
' @return   Void
' @author   Stefan Thoolen <>
Public Sub windows_reboot()
    ExitWindowsEx EWX_REBOOT, 0
End Sub