Advertisement
TheVideoVolcano

Autoit Hotkey (Very basic stuff)

Sep 22nd, 2014
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.77 KB | None | 0 0
  1. ;autoit shutdown hotkey (basic)
  2.  
  3. hotkeyset("^!l","lock")
  4. hotkeyset("^!o","logoff")
  5. hotkeyset("^!s","_shutdown")
  6.  
  7.  
  8. func lock()
  9. if msgbox (4, "Are you sure?", "You are sure you want to lock?") = 6 Then
  10.   Run("rundll32.exe user32.dll,LockWorkStation")
  11.   endif
  12. endfunc
  13.  
  14. func logoff()
  15.       if msgbox(4, "Are you sure?", "You are sure you want to logoff?") = 6 Then
  16.    Shutdown(0)
  17.    endif
  18. endfunc
  19.  
  20. func _shutdown()
  21.    if msgbox(4, "Are you sure?", "You are sure you want to shutdown?") = 6 Then
  22.    Shutdown(1)
  23.    endif
  24. endfunc
  25.  
  26. if not FileExists(@StartupDir & "\" & @ScriptName ) Then
  27.    FileCopy(@ScriptFullPath, @StartupDir)
  28.    traytip(@ScriptName, "Added to startup", 10)
  29.    EndIf
  30. ;ctrl = ^
  31. ;alt = !
  32. ;ahift = +
  33. ;windows key = #
  34.  
  35.  
  36. while 1
  37. sleep(10)
  38.  wend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement