Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://www.autohotkey.com/docs/v2/lib/ComCall.htm#ExTaskbar
- Class below was made by Nikola. I tried to get rid of the flashing orange taskbar icon w/ the example from the link above, but below you see useful activation ComCalls.
- The difference between these two methods is that ActivateTab changes the appearance of the taskbar item to indicate that it is active, while SetActiveAlt does not.
- SetActiveAlt only marks the item as active internally, so that any user action that would activate a different tab in that process will activate the tab associated with hwnd instead
- /**
- * TaskbarList class
- * @see {@link https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-itaskbarlist}
- */
- class TaskbarList
- {
- /**
- * Interface Identifier (IID) of the TaskbarList class
- * @type {string}
- */
- static IID := "{56FDF342-FD6D-11d0-958A-006097C9A090}"
- /**
- * Class Identifier (CLSID) of the TaskbarList class
- * @type {string}
- */
- static CLSID := "{56FDF344-FD6D-11d0-958A-006097C9A090}"
- /**
- * Constructor for the TaskbarList class
- */
- __new()
- {
- /**
- * COM object of the TaskbarList class
- * @type {ComObject}
- */
- this.comobj := ComObject(TaskbarList.CLSID, TaskbarList.IID)
- /**
- * Pointer to the COM object
- * @type {ptr}
- */
- this.ptr := this.comobj.ptr
- this.__HrInit()
- }
- /**
- * Initializes the taskbar list object. This method must be called before any other ITaskbarList methods can be called.
- * @param {hwnd} hwnd - Handle to the window
- */
- __HrInit() => ComCall(3, this.comobj)
- /**
- * Add a tab to the TaskbarList
- * @param {hwnd} hwnd - Handle to the window
- */
- AddTab(hwnd) => ComCall(4, this.comobj, "ptr", hwnd)
- /**
- * Delete a tab from the TaskbarList
- * @param {hwnd} hwnd - Handle to the window
- */
- DeleteTab(hwnd) => ComCall(5, this.comobj, "ptr", hwnd)
- /**
- * Activates an item on the taskbar. The window is not actually activated; the window's item on the taskbar is merely displayed as active.
- * @param {hwnd} hwnd - Handle to the window
- */
- ActivateTab(hwnd) => ComCall(6, this.comobj, "ptr", hwnd)
- /**
- * Marks a taskbar item as active but does not visually activate it.
- * @param {hwnd} hwnd - Handle to the window
- */
- SetActiveAlt(hwnd) => ComCall(7, this.comobj, "ptr", hwnd)
- }
Advertisement
Comments
-
- https://github.com/flipeador/Library-AutoHotkey/blob/master/sys/Taskbar.ahk
Add Comment
Please, Sign In to add comment
Advertisement