Skip to content

Conversation

@Asteski
Copy link

@Asteski Asteski commented Oct 30, 2025

Start Button Actions

This mod allows you to assign custom actions to various Start button clicks and Windows key press while preserving all default Windows key combinations (Win+R, Win+L, Win+D, etc.).

Features

  • Start Button Click Actions: Configure different actions for left-click, right-click, middle-click, Shift+click, and Ctrl+click on the Start button
  • Windows Key Custom Action: Run any command when pressing Windows key alone
  • Preserves All Shortcuts: All Windows key combinations (Win+R, Win+L, Win+D, etc.) continue to work normally
  • Environment Variables: Support for environment variables in custom commands (e.g., %USERPROFILE%)

Settings

Start Button Actions

Each type of click on the Start button can be configured independently:

  • Left Click: Default Start menu behavior or custom command
  • Right Click: Default WinX menu behavior or custom command
  • Middle Click: Custom command or disabled
  • Shift+Left Click: Custom command or disabled
  • Ctrl+Left Click: Custom command or disabled

Windows Key Action

  • Default: Opens the default Windows start menu
  • Custom Command: Executes a custom command specified below
  • Disabled: Windows key behaves normally (no custom action)

Elevation for Custom Commands

  • Run Custom Actions As: Choose whether custom commands run as standard user (unelevated) or as administrator. When Windhawk runs elevated, selecting "Standard user" ensures your commands run without admin rights.

Command Examples

  • notepad.exe - Opens Notepad
  • cmd.exe - Opens Command Prompt
  • %PROGRAMFILES%\Everything\Everything.exe - Launch Everything search
  • powershell.exe -Command "Get-Process" - PowerShell command

How It Works

The mod installs low-level keyboard and mouse hooks that monitor Start button clicks and Windows key events:

  1. Start Button: Detects mouse clicks and modifier keys, executes configured actions
  2. Windows Key: Detects solo key press vs combinations, executes custom action only when pressed alone
  3. All default Windows functionality is preserved

Compatibility

  • Works on Windows 10 and Windows 11
  • Does not interfere with existing Windows functionality
  • Can be safely disabled/enabled without system restart

Issues

  • Custom action bound to the Windows key doesn’t activate on the first attempt when an elevated window is in focus

@Asteski
Copy link
Author

Asteski commented Oct 30, 2025

@m417z I was wondering how to tackle issue with windows key I've mentioned in the readme. Should I remove that option from the mod, keep it or maybe you'd have an idea how to solve it. It works somehow in Open-Shell-Menu, but couldn't figure out how to solve that problem.

HANDLE thread = OpenThread(THREAD_SET_CONTEXT, FALSE, threadId);
if (thread) {
// Queue an APC to unregister hotkeys in the correct thread context
QueueUserAPC(UnregisterHotkeysAPC, thread, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right, the start menu isn't part of explorer.exe, and the mod only targets explorer.exe. How does this work?

}

// Decide elevation behavior
bool wantUnelevated = (g_runCustomActionsAs == "user");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the assumption here that the current process is elevated? explorer.exe is normally not elevated.

return nullptr;
}

std::wstring GetModuleDirectory() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is unused.

SendVirtualKey(VK_ESCAPE, false);
}

void ClickStartButton() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is unused.

@m417z
Copy link
Member

m417z commented Oct 31, 2025

@m417z I was wondering how to tackle issue with windows key I've mentioned in the readme. Should I remove that option from the mod, keep it or maybe you'd have an idea how to solve it. It works somehow in Open-Shell-Menu, but couldn't figure out how to solve that problem.

Normally, a non-elevated process can't simulate keyboard/mouse events as long as an elevated window is on the foreground. That's a security measure. I don't think there's a workaround for it.

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