Advertisement
OgreVorbis

Hide Windows

Feb 12th, 2023
2,264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.03 KB | None | 0 0
  1.  
  2. #cs
  3. Local $toggle = False
  4. Local $origHWnd
  5.  
  6. HotKeySet("^`", "HideWin")
  7.  
  8. Func HideWin()
  9.     If $toggle = False Then
  10.         $origHWnd = WinGetHandle("[ACTIVE]")
  11.         WinSetState("[ACTIVE]", "", @SW_HIDE)
  12.         $toggle = True
  13.     Else
  14.         WinSetState($origHWnd, "", @SW_SHOW)
  15.         WinActivate($origHWnd)
  16.         $toggle = False
  17.     EndIf
  18. EndFunc
  19.  
  20. While True
  21.     GUIGetMsg()
  22. WEnd
  23. #CE
  24.  
  25. #include <Array.au3>
  26.  
  27. Local $toggleWin[3] = [False, False, False]
  28. Local $origHWnd[3]
  29.  
  30. HotKeySet("^!1", "HideWin1")
  31. HotKeySet("^!2", "HideWin2")
  32. HotKeySet("^!3", "HideWin3")
  33.  
  34. Func HideWin1()
  35.     DoHideWin(0)
  36. EndFunc
  37. Func HideWin2()
  38.     DoHideWin(1)
  39. EndFunc
  40. Func HideWin3()
  41.     DoHideWin(2)
  42. EndFunc
  43.  
  44. Func DoHideWin($winNumber)
  45.     If $toggleWin[$winNumber] = False Then
  46.         $origHWnd[$winNumber] = WinGetHandle("[ACTIVE]")
  47.         WinSetState("[ACTIVE]", "", @SW_HIDE)
  48.         $toggleWin[$winNumber] = True
  49.     Else
  50.         WinSetState($origHWnd[$winNumber], "", @SW_SHOW)
  51.         WinActivate($origHWnd[$winNumber])
  52.         $toggleWin[$winNumber] = False
  53.     EndIf
  54. EndFunc
  55.  
  56. While True
  57.     GUIGetMsg()
  58. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement