Create an account

VPet-Simulator - AHK script to remove ALT-Tab window

Upload: 23 Aug 2023, 06:28
Uploaded by: Aqxaro
VPet-Simulator - AHK script to remove ALT-Tab window

Hi, welcome to this post. We hope you find the following page, where we detail the VPet-Simulator - AHK script to remove the ALT-Tab window, informative.

How it works

The script changes the window type to a palette window, which does not have an Alt-tab entry by default.

To use it you can:

  • Run script with Autohotkey
  • Press CTRL+ALT+F12 while vpet window has focus
  • You can now safely remove the script from the system tray

It's also good to note that you can turn the switch back on using the same key combination.

Scenario

; 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] := is
 ; 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 allows you to change various window attributes, in particular the extended style (ExStyle) for Windows. ExStyle controls the appearance and behavior of individual windows; with its use by this script (a bitwise AND operator to toggle its value, you can add and remove certain attributes in ExStyle, causing changes in both the appearance and behavior of windows.

Extended styles are attributes that control the visual and behavioral characteristics of a window. AutoHotkey can manipulate these styles using the ExStyle Parameter WinSet Function. In this script, the winset exstyle is used to add or remove an extended style corresponding to the value 0x80 .

Style 0x80 corresponds to the WS_EX_TOOLWINDOW extended style. This style determines how the window will be displayed in the Alt+Tab switcher and on the taskbar.

`WS_EX_TOOLWINDOW` (0x80 – :

  • This style makes the window a tool window, which means it won't show up when you toggle Alt+Tab by default.
  • Tool windows should only be used for floating toolbars or helper dialogs. They should not appear in the Alt+Tab list or on the taskbar.
  • By adding a style to a specific window, it is effectively hidden from the Alt+Tab menu.

Summary: The script uses WinSet to toggle WS_EX_TOOLWINDOW for specified windows, effectively controlling whether the window is displayed in Alt+Tab. When this style is added by a script to an extended Windows style, this window is hidden from Alt+Tab.

This VPet-Simulator - AHK script to remove the ALT-Tab window manual has come to an end. Please contact us and let us know if you have any issues, questions or suggestions on how we can improve this theme. Thank you very much for your concern and I hope you have a wonderful day! This artwork was inspired by the author and creator April. Also, if you liked the post, don't forget to bookmark us; We update new posts every day with additional content, so be sure to check back often for new posts.

Comments
The minimum comment length is 10 characters. Comments are moderated