Skip to content

Create taskbar-ctrl-rightclick-open-file-location.wh.cpp#4058

Open
triatomic wants to merge 3 commits into
ramensoftware:mainfrom
triatomic:add-taskbar-ctrl-rightclick-open-file-location
Open

Create taskbar-ctrl-rightclick-open-file-location.wh.cpp#4058
triatomic wants to merge 3 commits into
ramensoftware:mainfrom
triatomic:add-taskbar-ctrl-rightclick-open-file-location

Conversation

@triatomic
Copy link
Copy Markdown
Contributor

@triatomic triatomic commented May 13, 2026

Summary

New mod: hold a configurable modifier (default Ctrl) while clicking a taskbar button to:

  • Open the running program's file location in Explorer (default)
  • Copy the executable path to the clipboard
  • Launch a new elevated instance (UAC prompt)

Works on the classic taskbar (MSTaskListWClass):

  • Stock Windows 10
  • Windows 11 with StartAllBack
  • Windows 11 with ExplorerPatcher (legacy taskbar mode)

The mod subclasses MSTaskListWClass so the right-click never reaches the taskbar's own context-menu handler (this is what makes it work on StartAllBack, which doesn't go through taskbar.dll's _ComputeJumpViewPosition). Button-to-process resolution uses MSAA AccessibleObjectFromPoint and, when the accessible value doesn't expose an HWND directly (the StartAllBack case), a fallback that matches against the exe's FileDescription version-info field with alphanumeric normalization (handles e.g. ConEmu (x64)ConEmu64.exe, MSI AfterburnerMSIAfterburner.exe).

Settings

  • Modifier key — Ctrl / Shift / Alt / Win / None
  • Mouse button — Right (suppresses jump list) / Middle
  • Action — Open location / Copy path / Run as admin
  • Hold time (ms) — 0 for instant, or require the click to be held for N ms before firing

Mod authorship

This mod was created by:

    • The submitter, without AI assistance
    • The submitter, with AI assistance
    • Claude
    • ChatGPT
    • Gemini
    • Another AI (please specify):
    • Other (please specify):

Test plan

  • Install on Windows 11 with StartAllBack: Ctrl+Right-click a taskbar button opens its .exe location in Explorer without showing the SAB jump list
  • Grouped buttons (multiple windows) resolve to the right .exe
  • Ungrouped / single-window buttons resolve correctly
  • Switching settings (modifier, mouse button, action, hold time) takes effect without restarting explorer
  • Disabling/unloading the mod cleanly removes the subclass — no taskbar crash

triatomic added 2 commits May 14, 2026 02:27
New mod: hold a configurable modifier (default Ctrl) while right-clicking
a taskbar button to open the running program's file location in Explorer,
copy its path to the clipboard, or launch a new elevated instance.

Targets the classic taskbar (MSTaskListWClass) used by stock Windows 10,
Windows 11 with StartAllBack, and ExplorerPatcher in legacy mode. The
suppression of the jump-list/context menu is done by subclassing the
taskbar window, and the button-to-process resolution uses MSAA plus the
exe's FileDescription, so no private taskbar.dll symbols are required.
@m417z
Copy link
Copy Markdown
Member

m417z commented May 15, 2026

Any thoughts about supporting the Windows 11 taskbar? I believe that's what most Windhawk users use.
Several mods demonstrate how to subclass it and receive events, for example "Taskbar Volume Control" or "Click on empty taskbar space".

WNDPROC InputSiteWindowProc_Original;
LRESULT CALLBACK InputSiteWindowProc_Hook(HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam) {
switch (uMsg) {
case WM_POINTERWHEEL:
if (HWND hRootWnd = GetAncestor(hWnd, GA_ROOT);
IsTaskbarWindow(hRootWnd) &&
OnMouseWheel(hRootWnd, wParam, lParam)) {
return 0;
}
break;
}
return InputSiteWindowProc_Original(hWnd, uMsg, wParam, lParam);
}

Add support for the native Windows 11 XAML taskbar.

- Hook the wndproc of Windows.UI.Input.InputSite.WindowClass (under
  DesktopWindowContentBridge under Shell_TrayWnd) to intercept the
  configured pointer event before XAML opens the jump list. Inputsite.dll
  rejects subclassing, so use WindhawkUtils::SetFunctionHook on the
  wndproc instead.
- New taskbarType setting (auto / classic / win11) to pick which path(s)
  to install. Auto attaches both.
- Hook CreateWindowExW and CreateWindowInBand to catch InputSite windows
  created after init (secondary monitor attach, taskbar relocation).
- For button identification on Win11, IUIAutomation::ElementFromPoint
  descends into the XAML tree where AccessibleObjectFromPoint stops at
  the DesktopWindowXamlSource host. The button's UIA Name feeds the
  existing FindWindowByLabel / FileDescription matching.
@triatomic
Copy link
Copy Markdown
Contributor Author

Updated to support native windows 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants