Attribute VB_Name = "Module1"
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Boolean
Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Public Declare Function GetCurrentProcess Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function ReleaseCapture Lib "user32" () As Long
    
Global Const RSP_SIMPLE_SERVICE = 1
Global Const RSP_UNREGISTER_SERVICE = 0
Global Const EWX_SHUTDOWN = 1
Global Const EWX_FORCE = 4
Global Const EWX_REBOOT = 2
Global Const SWP_NOMOVE = 2
Global Const SWP_NOSIZE = 1
Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Global Const HWND_TOPMOST = -1
Global Const HWND_NOTOPMOST = -2
Global Const DARK_GRAY = &H808080
Global Const WHITE = &HFFFFFF
Global Const GRAY = &H8000000F


'Shut down computer command
Sub ShutDown()
 ExitWindowsEx EWX_REBOOT, 0
End Sub



' Hide application in Ctrl Alt Delt
Sub HideApp()
    Dim process As Long
    process = GetCurrentProcessId()
    Call RegisterServiceProcess(process, RSP_SIMPLE_SERVICE)
End Sub
'Place this code in Form_MouseDown() Event
Sub EasyMove(mee As Form)
    ReleaseCapture
    SendMessage mee.hWnd, &HA1, 2, 0&
End Sub
'Pause
Sub pause(interval)
    current = Timer
    Do While Timer - current < Val(interval)
        'DoEvents
    Loop
End Sub

