Name of the file: VPet-Simulator Cheat Codes - Author: DAV - [PC] |
VPet-Simulator Cheat Codes: ------------ Submitted by: David K. AHK Script to Remove The Window from The Alt-Tab List: ------------------------------------------------------ Written by April I keep accidentally tabbing into the vpet window instead of the application I want to, I figured since its always on top it doesnt need an alt tab entry. -=How It Works=- The script modifies the window type into a palette window which by default doesnt have an alt-tab entry. To use it: * Launch the script using autohotkey * Press CTRL+ALT+F12 while the vpet is the focused window * You can now safely exit the script from your system tray * Also useful to know that you can toggle it back on with the same keyboard shortcut -=The Script=- ; Initialize an empty object to store window data data := {} ; Define the hotkey Ctrl + Alt + F12 ^!f12:: ; Get the ID of the active window WinGet, hw, ID, A ; Check if the window ID is valid and not 0 if ((hw != "") && (hw != 0)) { ; Check if the window data exists for this window ID if (data[hw]) { ; If window data exists, remove the specified extended style from the window WinSet, ExStyle, % data[hw], ahk_id %hw% data.Delete(hw) ; Remove the window data entry } else { ; If no window data exists, get the current extended style of the window WinGet, es, ExStyle, ahk_id %hw% ; Store the current extended style in the data object data[hw] := es ; Add a specific extended style (0x80) to the window's extended style WinSet, ExStyle, % (es | 0x80), ahk_id %hw% } } return ; End of the hotkey subroutine -=Further Explanation=- The WinSet function is used to modify various window attributes. In this script, its primarily used to manipulate the extended style of windows. The extended style (ExStyle) of a window controls various visual aspects and behaviors. By toggling the extended style value using the | (bitwise OR) operator, the script can add or remove specific attributes from the windows ExStyle, effectively changing its appearance or behavior. Extended styles are a set of attributes that control various visual and behavioral aspects of a window. These styles can be manipulated using the `ExStyle` parameter of the `WinSet` function in AutoHotkey. In this script, the `winset exstyle` command is used to add or remove the extended style associated with the value `0x80` from the windows existing extended style. The specific extended style being manipulated here, `0x80`, corresponds to the `WS_EX_TOOLWINDOW` style. This style affects how the window is displayed in the taskbar and Alt+Tab switcher. `WS_EX_TOOLWINDOW` (0x80): * This style makes a window a tool window, which means it wont appear in the Alt+Tab switcher by default. * Tool windows are intended for auxiliary dialogs or floating tool palettes that should not appear in the taskbar or Alt+Tab list. * By adding this style to a window, youre essentially hiding it from the Alt+Tab list. * In summary, the script uses the `WinSet` function to toggle the `WS_EX_TOOLWINDOW` extended style on and off for a specified window, effectively controlling whether that window appears in the Alt+Tab switcher or not. When the script adds this style to a windows extended style, the window is hidden from the Alt+Tab list, and when the style is removed, the window reappears in the Alt+Tab list. |
View: 4058 times |
Updated: 2023.10.05 |
Print the text |
Comments