Advertisement
Nick_Fair

AlwaysOnTop+ AutoHotKey Script

Apr 24th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. #InstallKeybdHook
  2. #SingleInstance force
  3. /*
  4. Hotkeys:
  5. Alt-A: make window always on top
  6.  
  7. Alt-W: make window less transparent
  8. Alt-S: make window more transparent
  9.  
  10. Alt-X: make window clickthoughable
  11. Alt-Z: make window under mouse unclickthroughable
  12. */
  13.  
  14. !a::
  15. WinGet, currentWindow, ID, A
  16. WinGet, ExStyle, ExStyle, ahk_id %currentWindow%
  17. if (ExStyle & 0x8) ; 0x8 is WS_EX_TOPMOST.
  18. {
  19. Winset, AlwaysOnTop, off, ahk_id %currentWindow%
  20. SplashImage,, x0 y0 b fs12, OFF always on top.
  21. Sleep, 1500
  22. SplashImage, Off
  23. }
  24. else
  25. {
  26. WinSet, AlwaysOnTop, on, ahk_id %currentWindow%
  27. SplashImage,,x0 y0 b fs12, ON always on top.
  28. Sleep, 1500
  29. SplashImage, Off
  30. }
  31. return
  32.  
  33. !w::
  34. WinGet, currentWindow, ID, A
  35. if not (%currentWindow%)
  36. {
  37. %currentWindow% := 255
  38. }
  39. if (%currentWindow% != 255)
  40. {
  41. %currentWindow% += 5
  42. WinSet, Transparent, % %currentWindow%, ahk_id %currentWindow%
  43. }
  44. SplashImage,,w100 x0 y0 b fs12, % %currentWindow%
  45. SetTimer, TurnOffSI, 1000, On
  46. Return
  47.  
  48. !s::
  49. SplashImage, Off
  50. WinGet, currentWindow, ID, A
  51. if not (%currentWindow%)
  52. {
  53. %currentWindow% := 255
  54. }
  55. if (%currentWindow% != 5)
  56. {
  57. %currentWindow% -= 5
  58. WinSet, Transparent, % %currentWindow%, ahk_id %currentWindow%
  59. }
  60. SplashImage,, w100 x0 y0 b fs12, % %currentWindow%
  61. SetTimer, TurnOffSI, 1000, On
  62. Return
  63.  
  64. !x::
  65. WinGet, currentWindow, ID, A
  66. WinSet, ExStyle, +0x80020, ahk_id %currentWindow%
  67. return
  68.  
  69. !z::
  70. MouseGetPos,,, MouseWin ; Gets the unique ID of the window under the mouse
  71. WinSet, ExStyle, -0x80020, ahk_id %currentWindow%
  72. Return
  73.  
  74. TurnOffSI:
  75. SplashImage, off
  76. SetTimer, TurnOffSI, 1000, Off
  77. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement