Skip to content

Add hide-rdp-connection-bar mod#4073

Open
StarlightDaemon wants to merge 1 commit into
ramensoftware:mainfrom
StarlightDaemon:add-hide-rdp-connection-bar
Open

Add hide-rdp-connection-bar mod#4073
StarlightDaemon wants to merge 1 commit into
ramensoftware:mainfrom
StarlightDaemon:add-hide-rdp-connection-bar

Conversation

@StarlightDaemon
Copy link
Copy Markdown

Summary

New mod: permanently hides the floating RDP connection bar (BBarWindowClass) in fullscreen mstsc.exe sessions on Windows 11, where the native hide options (the pin button, the client toggle, and displayconnectionbar:i:0 in the .rdp file) don't persist reliably.

Hooks four Win32 APIs inside mstsc.exe — CreateWindowExW, ShowWindow, SetWindowPos, and SetWindowTextW — to detect and suppress the bar at the process level. All original calls complete normally.

Optionally shows a clean disconnect button pinned to any corner of the screen with live hostname display, idle fade, configurable hotkey with conflict detection, multi-monitor awareness, and full DPI scaling.

Test plan

  • Bar is hidden immediately on session start in fullscreen mstsc.exe
  • Bar stays hidden after Ctrl+Alt+Home and any subsequent mstsc show attempts
  • Disconnect button appears in the correct corner with correct DPI scaling
  • Button repositions correctly when the RDP window moves to a different monitor
  • Hostname updates live as mstsc resolves the remote host
  • Hotkey registers and disconnects correctly; conflict state displays on button when registration fails
  • Settings changes apply correctly via Wh_ModSettingsChanged
  • Mod unloads cleanly — original wndproc restored, no mstsc crash

Changelog

If this pull request updates an existing mod, describe the changes below:

N/A — new mod.

Mod authorship

If this pull request introduces a new mod, please complete the section below.
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):

Please select the options that best apply. Your selection does not affect the acceptance criteria, but it helps reviewers understand the context of the code and provide relevant feedback.


g_origBBarWndProc = reinterpret_cast<WNDPROC>(
SetWindowLongPtrW(hwnd, GWLP_WNDPROC,
reinterpret_cast<LONG_PTR>(BBarSubclassProc)));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changing GWLP_WNDPROC directly might conflict with other mods. Prefer using WindhawkUtils::SetWindowSubclassFromAnyThread. Look at existing mods for reference.

@m417z
Copy link
Copy Markdown
Member

m417z commented May 16, 2026

There's a feature request to be able to resize the bar: #2116
I don't think this mod addresses this, right? Would you like to add 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