home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / ProjectX1_562922192002.psc / ModulesSystem / modSystemX1.bas next >
Encoding:
BASIC Source File  |  1997-02-19  |  2.2 KB  |  63 lines

  1. Attribute VB_Name = "modSystemX1"
  2. '-----------------------------------
  3. '-
  4. '-  WARNING: These module has some DANGEROUS
  5. '-     functions in it:
  6. '-
  7. '-  TvBlockInput (Can't press a button/Move mouse)
  8. '-  QWindows (Quit Windows)
  9. '-
  10. '-   By T-Virus Creations
  11. '- http://www.tvirusonline.be
  12. '- email: tvirus4ever@yahoo.co.uk
  13. '-
  14. '-----------------------------------
  15.  
  16. Const EWX_FORCE = 4
  17. Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
  18. Private Declare Function fCreateShellLink Lib "VB5STKIT.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
  19. Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
  20. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  21. Public Sub TvBlockInput(Always As Boolean, Optional TimeToSleep As Long, Optional IsInSeconds As Boolean)
  22.  
  23.     DoEvents
  24.     If Always = True Then
  25.     'block the mouse and keyboard input
  26.       BlockInput True
  27.       Exit Sub
  28.     End If
  29.     If TimeToSleep = 0 Then Exit Sub
  30.           BlockInput True
  31.     'block the mouse and keyboard input
  32.     BlockInput True
  33.     If IsInSeconds = True Then TimeToSleep = TimeToSleep * 1000
  34. Debug.Print TimeToSleep
  35.     Sleep TimeToSleep
  36.     'unblock the mouse and keyboard input
  37.     BlockInput False
  38. End Sub
  39. Public Sub TvEnableInput()
  40.     'unblock the mouse and keyboard input
  41.     BlockInput False
  42. End Sub
  43.  
  44. Public Sub TvCreateLink(PutLinkIn As String, LinkName As String, LinksTo As String)
  45. lng = fCreateShellLink(PutLinkIn, LinkName, LinksTo, "")
  46. End Sub
  47.  
  48. Public Sub QWindows(DoWhat As Integer, ShowWarning As Boolean)
  49. Dim Message As String
  50.  
  51. If DoWhat = 0 Then Message = "LogOff you from Windows"
  52. If DoWhat = 1 Then Message = "Shut Down the computer"
  53. If DoWhat = 2 Then Message = "Reboot the computer"
  54. If DoWhat > 2 Then Exit Sub
  55. If DoWhat < 0 Then Exit Sub
  56. If ShowWarning = True Then
  57.     msg = MsgBox("This program is going to " + Message + ". Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + 256, "WARNING!")
  58.     If msg = vbCancel Then Exit Sub
  59. End If
  60.     Ret& = ExitWindowsEx(EWX_FORCE Or DoWhat, 0)
  61. End Sub
  62.  
  63.