Hi, welcome to this post, We hope you find the following page, in which we detail the VPet-Simulator – AHK script to delete ALT-Tab window, informative.
How it works
The script modifies window type into a Palette window that by default does not have a Alt-tab entry.
To use it, you can:
- Launch the script using Autohotkey
- Press CTRL+ALT+F12 whilst the vpet focuses window
- You can now safely delete the script from the system tray
It is also helpful to note that you can toggle the switch back on using the same key 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
WinSet is a function that enables the modification of various window attributes, particularly extended style (ExStyle) for Windows. ExStyle controls visual appearance and behavior for individual windows; with it’s use by this script (bitwise AND operator to toggle it’s value, it is possible to add and remove specific attributes to ExStyle causing changes in both appearance or behavior of windows.
Extended styles are attributes that control visual and behavioral characteristics of a Window. AutoHotkey can manipulate these styles by using the ExStyle Parameter of the WinSet Function. In this script, winset exstyle is used in order to add or remove an extended style that corresponds to the value 0x80.
The style 0x80 corresponds with the WS_EX_TOOLWINDOW extended style. This style controls how the window will appear in the Alt+Tab switcher and the taskbar.
`WS_EX_TOOLWINDOW` (0x80 – :
- This style makes a Window a Tool window, which means that it will not appear in the Alt+Tab switching by default.
- Tool windows should only be used for floating toolbars or auxiliary dialogues. They shouldn’t appear in the Alt+Tab list or Taskbar.
- By adding the style to a particular window, it is effectively hidden from the Alt+Tab menu.
Summary: the script uses WinSet to toggle WS_EX_TOOLWINDOW for specified windows on and of, effectively controlling whether or not the window appears in Alt+Tab. When this style is added to a windows extended style by the script, that window is hidden from Alt+Tab.
This VPet-Simulator – AHK script to delete ALT-Tab window guide has come to an end. Please contact us and let us know if you have any concerns, questions, or suggestions about how we can improve this topic. Thank you very much for your thoughtfulness, and I hope you have a lovely day! This piece was motivated by the author and creator April. Also, if you like the post, don’t forget to save us to your bookmarks; we update new posts every day with additional material, so be sure to check back with us frequently for more posts.
- All VPet-Simulator Posts List
Leave a Reply