Last active
September 9, 2025 02:22
-
-
Save Ooseykins/d3ccb87ac858f27210ab27f4dbd6c35a to your computer and use it in GitHub Desktop.
AutoHotkey 2 script for changing window properties, for Vtubing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #SingleInstance | |
| ; Hotkey for toggling the title bar | |
| ; Removes the title bar fine, unstable adding it back | |
| #!0:: ToggleTitle() | |
| ; Hotkeys for progressively more opaque windows | |
| ; Colors matching the hex color (like 000000 for black) will be 100% transparent | |
| ; Other colors will be partially transparent | |
| #!1:: ToggleTransparency("000000 25") | |
| #!2:: ToggleTransparency("000000 50") | |
| #!3:: ToggleTransparency("000000 75") | |
| #!4:: ToggleTransparency("000000 100") | |
| #!5:: ToggleTransparency("000000 125") | |
| #!6:: ToggleTransparency("000000 150") | |
| #!7:: ToggleTransparency("000000 175") | |
| #!8:: ToggleTransparency("000000 200") | |
| #!9:: ToggleTransparency("000000 255") | |
| ToggleTransparency(color){ | |
| if(WinExist("A")){ ; Check the active window | |
| if (!StyledRight(WinExist("A"))){ | |
| return | |
| } | |
| ExStyle := WinGetExStyle() ; Get the ExStyle into a variable | |
| if (ExStyle & 0x80028){ ; WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOPMOST | |
| WinSetAlwaysOnTop(False) ; Remove window always on top | |
| WinSetExStyle(-0x80028) ; Remove clickthough and transparency. | |
| WinSetTransparent(255) | |
| WinSetTransparent("Off") ; Reset opacity | |
| } else { | |
| WinSetAlwaysOnTop(True) ; Set window always on top | |
| WinSetExStyle(+0x80028) ; Add clickthough and transparency. | |
| WinSetTransparent("Off") ; Reset opacity | |
| WinSetTransColor(color) ; Set transparency color | |
| } | |
| } | |
| } | |
| ToggleTitle(){ | |
| if(WinExist("A")){ ; Check the active window | |
| if (!StyledRight(WinExist("A"))){ | |
| return | |
| } | |
| Style := WinGetStyle() ; Get the Style into a variable | |
| if (Style & 0xC40000) { | |
| WinSetStyle(-0xC40000) | |
| } else { | |
| WinSetStyle(+0xC40000) | |
| } | |
| } | |
| } | |
| ; Checking for regular window styles from: | |
| ; https://www.reddit.com/r/AutoHotkey/comments/1m4lpuv/never_used_autohotkey_but_have_a_question/ | |
| StyledRight(hwnd) | |
| { | |
| ExStyle := WinGetExStyle(hwnd) | |
| Return (ExStyle & 0x8000000) ? False ; WS_EX_NOACTIVATE | |
| : (ExStyle & 0x40000) ? True ; WS_EX_APPWINDOW | |
| : (ExStyle & 0x80) ? False ; WS_EX_TOOLWINDOW | |
| : True | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment