Skip to content

UPDATE: added new mappings and redirects for the system tray#4392

Merged
m417z merged 22 commits into
ramensoftware:mainfrom
babamohammed2022:patch-2
Jul 7, 2026
Merged

UPDATE: added new mappings and redirects for the system tray#4392
m417z merged 22 commits into
ramensoftware:mainfrom
babamohammed2022:patch-2

Conversation

@babamohammed2022

Copy link
Copy Markdown
Contributor

UPDATE: added new mappings and redirects for the system tray

Changelog

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

  • added new mappings
  • added redirects to the control panel for the system tray

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): Deepseek
    • 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.

UPDATE: added new mappings and redirects for the system tray
@Anixx

Anixx commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Doеs not work in tray context menu for me, opens Settings as before.

@babamohammed2022

babamohammed2022 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

Dots not work in tray context menu for me, opens Settings as before.

If possible, show me the settings of the mod since I've added this as a setting so that I can troubleshoot this further
image

@Anixx

Anixx commented Jun 13, 2026

Copy link
Copy Markdown
Contributor
изображение With this option enabled, also opens Settings.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

изображение With this option enabled, also opens Settings.

Thank you for sharing this image. I've tested it on Windows 10 21H2 and it works but since I can't test it on Windows 11 I assume that the issue is ExplorerPatcher since the Windows 10 taskbar from ExplorerPatcher could work differently from the original Windows 10 one

@Anixx

Anixx commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

I do not use Explorer Patcher.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

I do not use Explorer Patcher.

Thanks for the clarification.
The mod has been currently tested only on Windows 10, so Windows 11 behavior for this specific situation is currently unverified. Since ExplorerPatcher is not involved, the issue is likely due to differences in the Windows 11 shell / system tray context menu handling compared to Windows 10, but this is not confirmed. I will review the system tray redirect/mapping logic to check for Windows 11-specific changes in how the context menu commands are resolved. If possible, it would help to know whether the same behavior occurs when using a fully default Windows 11 taskbar setup

@Anixx

Anixx commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Sorry, this is my bad. Your redirects now work for me.

@Anixx

Anixx commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

@m417z works for me now.

@Anixx

Anixx commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

I think, tray network context menu should aopenb this:
изображение
but it opens this:
изображение

- Changed a mapping 
- Removed less stable parts
@babamohammed2022

Copy link
Copy Markdown
Contributor Author

I think, tray network context menu should aopenb this: изображение but it opens this: изображение

Thank you for the suggestion. I've updated the mapping to make it more similar to Windows 7's

@Anixx

Anixx commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@babamohammed2022 can you fix here the redirect as well, the same way you did in the network mod?

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

@babamohammed2022 can you fix here the redirect as well, the same way you did in the network mod?

I will work on a fix for this mod soon, right now I'm focusing on the network flyout one to avoid disorganization but thanks for the reminder

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

@babamohammed2022 can you fix here the redirect as well, the same way you did in the network mod?

I've fixed them and they work.
Screenshots:
immagine
immagine
LOGS:
loaded
23:18:52.951 9536 explorer.exe [WH] [local@settings-to-control-panel] [1280:Wh_ModInit]: ShellExecuteExW hook=1 ShellExecuteW hook=1
23:18:52.951 9536 explorer.exe [WH] [local@settings-to-control-panel] [1299:Wh_ModInit]: Ready
23:18:55.921 9536 explorer.exe [WH] [local@settings-to-control-panel] [950:TrackPopupMenuEx_Hook]: TrackPopupMenuEx_Hook called, itemCount=2
23:18:55.921 9536 explorer.exe [WH] [local@settings-to-control-panel] [956:TrackPopupMenuEx_Hook]: firstItemId=3107
23:18:56.802 9536 explorer.exe [WH] [local@settings-to-control-panel] [962:TrackPopupMenuEx_Hook]: TrackPopupMenuEx result cmd=3109
23:18:56.803 9536 explorer.exe [WH] [local@settings-to-control-panel] [968:TrackPopupMenuEx_Hook]: FindTrayCommand(3109) = shell:::{7007ACC7-3202-11D1-AAD2-00805FC1270E}
23:19:01.469 9536 explorer.exe [WH] [local@settings-to-control-panel] [950:TrackPopupMenuEx_Hook]: TrackPopupMenuEx_Hook called, itemCount=2
23:19:01.470 9536 explorer.exe [WH] [local@settings-to-control-panel] [956:TrackPopupMenuEx_Hook]: firstItemId=3107
23:19:02.126 9536 explorer.exe [WH] [local@settings-to-control-panel] [962:TrackPopupMenuEx_Hook]: TrackPopupMenuEx result cmd=0
23:19:02.265 9536 explorer.exe [WH] [local@settings-to-control-panel] [950:TrackPopupMenuEx_Hook]: TrackPopupMenuEx_Hook called, itemCount=5
23:19:02.266 9536 explorer.exe [WH] [local@settings-to-control-panel] [956:TrackPopupMenuEx_Hook]: firstItemId=40012
23:19:03.245 9536 explorer.exe [WH] [local@settings-to-control-panel] [962:TrackPopupMenuEx_Hook]: TrackPopupMenuEx result cmd=40012
23:19:03.249 9536 explorer.exe [WH] [local@settings-to-control-panel] [968:TrackPopupMenuEx_Hook]: FindTrayCommand(40012) = rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,0
23:21:00.121 9536 explorer.exe [WH] [local@settings-to-control-panel] [950:TrackPopupMenuEx_Hook]: TrackPopupMenuEx_Hook called, itemCount=2
23:21:00.123 9536 explorer.exe [WH] [local@settings-to-control-panel] [956:TrackPopupMenuEx_Hook]: firstItemId=3107
23:21:01.397 9536 explorer.exe [WH] [local@settings-to-control-panel] [962:TrackPopupMenuEx_Hook]: TrackPopupMenuEx result cmd=3109
23:21:01.397 9536 explorer.exe [WH] [local@settings-to-control-panel] [968:TrackPopupMenuEx_Hook]: FindTrayCommand(3109) = shell:::{7007ACC7-3202-11D1-AAD2-00805FC1270E}
23:21:26.377 9536 explorer.exe [WH] [local@settings-to-control-panel] [950:TrackPopupMenuEx_Hook]: TrackPopupMenuEx_Hook called, itemCount=5
23:21:26.377 9536 explorer.exe [WH] [local@settings-to-control-panel] [956:TrackPopupMenuEx_Hook]: firstItemId=40012
23:21:28.017 9536 explorer.exe [WH] [local@settings-to-control-panel] [962:TrackPopupMenuEx_Hook]: TrackPopupMenuEx result cmd=40012
23:21:28.017 9536 explorer.exe [WH] [local@settings-to-control-panel] [968:TrackPopupMenuEx_Hook]: FindTrayCommand(40012) = rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,0

@Anixx

Anixx commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Tray redirect does not work, opens settings for me.

@babamohammed2022

This comment was marked as outdated.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

Tray redirect does not work, opens settings for me.

OK, I will try to fix it

@Anixx

Anixx commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Both open Settings.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

Both open Settings.

Hi, if possible let me know if it works now. I've replaced the hardcoded IDs with one that involves multiple approaches based on the Windows version and the presence of ExplorerPatcher to deal with the DLL.
If it doesn't work, please send me the logs so that I can analyze in an exhaustive way.
If there are any other issues please let me know

@Anixx

Anixx commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

How is this related to the IDs if it sometimes works, sometimes not?

@Anixx

Anixx commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Now, power settings redirects to CP, while sound settings open the Settings app.

Here is the log:
19:28:50.574 9108 explorer.exe [WH] [local@settings-to-control-panel] [1404:Wh_ModInit]: Redirect Settings to Control Panel v10.0.5
19:28:50.574 9108 explorer.exe [WH] [local@settings-to-control-panel] [229:DetectWindowsVersion]: Build 22631 IsWin11=1
19:28:50.576 9108 explorer.exe [WH] [local@settings-to-control-panel] [213:LoadSettings]: EnableRedirects=1 RedirectSystemTray=0 UIOnly=0 Fallback=2 Win11Compat=0 MaxLaunches=3
19:28:50.577 9108 explorer.exe [WH] [local@settings-to-control-panel] [598:IsWin11_24H2OrLater]: [VERSION] Windows 11 23H2 (2023 Update) (Build 22631, Is24H2=0, IsWin11=1)
19:28:50.578 9108 explorer.exe [WH] [local@settings-to-control-panel] [1422:Wh_ModInit]: 142 URI mappings loaded
19:28:50.578 9108 explorer.exe [WH] [local@settings-to-control-panel] [1434:Wh_ModInit]: ShellExecuteExW hook=1 ShellExecuteW hook=1
19:28:50.578 9108 explorer.exe [WH] [local@settings-to-control-panel] [1458:Wh_ModInit]: Ready

There are no log messages when clicking the menu item.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

How is this related to the IDs if it sometimes works, sometimes not?

Now, power settings redirects to CP, while sound settings open the Settings app.

Here is the log: 19:28:50.574 9108 explorer.exe [WH] [local@settings-to-control-panel] [1404:Wh_ModInit]: Redirect Settings to Control Panel v10.0.5 19:28:50.574 9108 explorer.exe [WH] [local@settings-to-control-panel] [229:DetectWindowsVersion]: Build 22631 IsWin11=1 19:28:50.576 9108 explorer.exe [WH] [local@settings-to-control-panel] [213:LoadSettings]: EnableRedirects=1 RedirectSystemTray=0 UIOnly=0 Fallback=2 Win11Compat=0 MaxLaunches=3 19:28:50.577 9108 explorer.exe [WH] [local@settings-to-control-panel] [598:IsWin11_24H2OrLater]: [VERSION] Windows 11 23H2 (2023 Update) (Build 22631, Is24H2=0, IsWin11=1) 19:28:50.578 9108 explorer.exe [WH] [local@settings-to-control-panel] [1422:Wh_ModInit]: 142 URI mappings loaded 19:28:50.578 9108 explorer.exe [WH] [local@settings-to-control-panel] [1434:Wh_ModInit]: ShellExecuteExW hook=1 ShellExecuteW hook=1 19:28:50.578 9108 explorer.exe [WH] [local@settings-to-control-panel] [1458:Wh_ModInit]: Ready

There are no log messages when clicking the menu item.

It looks like you have RedirectSystemTray=0 therefore it means that the option to redirect the system tray is disabled (I will make it enabled by default once I make it more stable). Please, enable it and let me know what happens.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

How is this related to the IDs if it sometimes works, sometimes not?

I changed the approach because before I used fixed menu IDs, now I detect menus by checking which DLL creates them (SndVolSSO.dll for audio, pnidui.dll for network) or by reading the menu text

@Anixx

Anixx commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

When enabled, its the same:

19:35:37.306 9108 explorer.exe [WH] [local@settings-to-control-panel] [1404:Wh_ModInit]: Redirect Settings to Control Panel v10.0.5
19:35:37.306 9108 explorer.exe [WH] [local@settings-to-control-panel] [229:DetectWindowsVersion]: Build 22631 IsWin11=1
19:35:37.307 9108 explorer.exe [WH] [local@settings-to-control-panel] [213:LoadSettings]: EnableRedirects=1 RedirectSystemTray=1 UIOnly=0 Fallback=2 Win11Compat=0 MaxLaunches=3
19:35:37.308 9108 explorer.exe [WH] [local@settings-to-control-panel] [598:IsWin11_24H2OrLater]: [VERSION] Windows 11 23H2 (2023 Update) (Build 22631, Is24H2=0, IsWin11=1)
19:35:37.311 9108 explorer.exe [WH] [local@settings-to-control-panel] [1422:Wh_ModInit]: 142 URI mappings loaded
19:35:37.311 9108 explorer.exe [WH] [local@settings-to-control-panel] [1434:Wh_ModInit]: ShellExecuteExW hook=1 ShellExecuteW hook=1
19:35:37.312 9108 explorer.exe [WH] [local@settings-to-control-panel] [1453:Wh_ModInit]: TrackPopupMenuEx hook=1
19:35:37.312 9108 explorer.exe [WH] [local@settings-to-control-panel] [1458:Wh_ModInit]: Ready
19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [433:IsPniDuiLoadedInProcess]: pnidui.dll loaded in memory from: C:\windows\System32\pnidui.dll
19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [449:IsPniDuiOnDisk]: pnidui.dll found in System32: C:\windows\system32\pnidui.dll
19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [698:TrackPopupMenuEx_Hook]: [TRAY] pnidui.dll status - In EP: 0, Loaded: 1, In System32: 1
19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [460:IsSndVolSSOLoadedInProcess]: SndVolSSO.dll loaded in memory from: C:\windows\SYSTEM32\SndVolSSO.DLL
19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [754:TrackPopupMenuEx_Hook]: [TRAY] No menu detected (items=5, retAddr=00007FF88288A620)
19:35:49.980 9108 explorer.exe [WH] [local@settings-to-control-panel] [1464:Wh_ModUninit]: Redirect Settings to Control Panel v10.0.5 unloaded.

@Anixx

Anixx commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

The menu text is different in all languages, plus it will bring false positives if some other software has these strings.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

When enabled, its the same:

19:35:37.306 9108 explorer.exe [WH] [local@settings-to-control-panel] [1404:Wh_ModInit]: Redirect Settings to Control Panel v10.0.5 19:35:37.306 9108 explorer.exe [WH] [local@settings-to-control-panel] [229:DetectWindowsVersion]: Build 22631 IsWin11=1 19:35:37.307 9108 explorer.exe [WH] [local@settings-to-control-panel] [213:LoadSettings]: EnableRedirects=1 RedirectSystemTray=1 UIOnly=0 Fallback=2 Win11Compat=0 MaxLaunches=3 19:35:37.308 9108 explorer.exe [WH] [local@settings-to-control-panel] [598:IsWin11_24H2OrLater]: [VERSION] Windows 11 23H2 (2023 Update) (Build 22631, Is24H2=0, IsWin11=1) 19:35:37.311 9108 explorer.exe [WH] [local@settings-to-control-panel] [1422:Wh_ModInit]: 142 URI mappings loaded 19:35:37.311 9108 explorer.exe [WH] [local@settings-to-control-panel] [1434:Wh_ModInit]: ShellExecuteExW hook=1 ShellExecuteW hook=1 19:35:37.312 9108 explorer.exe [WH] [local@settings-to-control-panel] [1453:Wh_ModInit]: TrackPopupMenuEx hook=1 19:35:37.312 9108 explorer.exe [WH] [local@settings-to-control-panel] [1458:Wh_ModInit]: Ready 19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [433:IsPniDuiLoadedInProcess]: pnidui.dll loaded in memory from: C:\windows\System32\pnidui.dll 19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [449:IsPniDuiOnDisk]: pnidui.dll found in System32: C:\windows\system32\pnidui.dll 19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [698:TrackPopupMenuEx_Hook]: [TRAY] pnidui.dll status - In EP: 0, Loaded: 1, In System32: 1 19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [460:IsSndVolSSOLoadedInProcess]: SndVolSSO.dll loaded in memory from: C:\windows\SYSTEM32\SndVolSSO.DLL 19:35:43.532 9108 explorer.exe [WH] [local@settings-to-control-panel] [754:TrackPopupMenuEx_Hook]: [TRAY] No menu detected (items=5, retAddr=00007FF88288A620) 19:35:49.980 9108 explorer.exe [WH] [local@settings-to-control-panel] [1464:Wh_ModUninit]: Redirect Settings to Control Panel v10.0.5 unloaded.

Thank you for sharing the logs, I will analyze them. For now it looks like it fails to intercept the context menus despite loading the DLLs

@m417z

m417z commented Jul 2, 2026

Copy link
Copy Markdown
Member

@Anixx would you like to test it before it's merged?

@Anixx

Anixx commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Troubleshooting in the Control Panel does not work. On the first click nothing happens, on the second, Settings open.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

Troubleshooting in the Control Panel does not work. On the first click nothing happens, on the second, Settings open.

Thank you for reporting the issue. Does it work now?

@Anixx

Anixx commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

"Open Devices and Printers" in the tray
изображение
opens Settings instead of the Devices and Printers folder.
Troubleshooting is fixed.

@babamohammed2022

babamohammed2022 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

"Open Devices and Printers" in the tray изображение opens Settings instead of the Devices and Printers folder. Troubleshooting is fixed.

OK, let me know if this issue has been addressed properly

@Anixx

Anixx commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No. It still opens Settings.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

"Open Devices and Printers" in the tray изображение opens Settings instead of the Devices and Printers folder. Troubleshooting is fixed.

OK, Let me know if this issue has been addressed properly

No. It still opens Settings.

Alright, I'll check again and try to implement a more robust solution

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

No. It still opens Settings.

I've tested on Windows 11 24H2 with ExplorerPatcher and Device & Printers tray redirect seems to work correctly
LOG:
00:12:58.940 8832 explorer.exe [WH] [local@settings-to-control-panel] [554:TrackPopupMenuEx_Hook]: [TRAY-HOOK] Device menu detected via dxgi.dll + ID 215
00:12:58.956 8832 explorer.exe [WH] [local@settings-to-control-panel] [582:TrackPopupMenuEx_Hook]: [TRAY-HOOK] DEVICE menu, 4 items
00:12:58.956 8832 explorer.exe [WH] [local@settings-to-control-panel] [633:TrackPopupMenuEx_Hook]: [TRAY-HOOK] DEVICE menu target index=0, ID=215
00:12:59.868 8832 explorer.exe [WH] [local@settings-to-control-panel] [655:TrackPopupMenuEx_Hook]: [TRAY-HOOK] User selected target item, redirecting
00:13:00.000 8908 explorer.exe [WH] [local@settings-to-control-panel] [1253:Wh_ModInit]: Redirect Settings to Control Panel v10.0.18
00:13:00.316 7668 explorer.exe [WH] [local@settings-to-control-panel] [1253:Wh_ModInit]: Redirect Settings to Control Panel v10.0.18

Audio and Network seem to work too. I've added a note in the README limitations about this not working in all configurations for transparency, despite it working on my setup. Let me know if there are other issues to address

@Anixx

Anixx commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

The last version opens Settings instead of Files and Printers.

@babamohammed2022

babamohammed2022 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

The last version opens Settings instead of Files and Printers.

OK, what about the redirect of the USB in the system tray? does it work now?

@Anixx

Anixx commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

No, the system tray item "Devices and Printers" opens Setting

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

No, the system tray item "Devices and Printers" opens Setting

Have you enabled the system tray redirect in the settings? Just to confirm

@Anixx

Anixx commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Yes, also in the last version the network settings redirect in tray also does not work. The sound redirect works.

изображение

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

Yes, also in the last version the network settings redirect in tray also does not work. The sound redirect works.

изображение

Fair, I'll try to fix both issues

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

I've marked the system tray redirect as experimental and documented the Device & Printers limitation in the README.
This is the situation so far:

  • Audio and Network tray redirect should work properly as I've reverted them to the previous version
  • Device and Printers redirect is not reliable as it seems like Microsoft hardcoded the redirect and I've been trying to fix it for multiple hours without success
    Unfortunately, the Device and Printers redirect does not work on Windows 11 while it works natively with Windows 10. If someone with direct access to Windows 11 23H2 wants to contribute a fix, I'd be happy to collaborate.
    If there are any other issues to address, I'll try to fix them

@Anixx

Anixx commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Confirming, all redirects work except Files and Printers.

@Anixx

Anixx commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

@m417z while one feature is not implemented, the current version is no doubt, an improvement.

@m417z m417z merged commit f31ffa0 into ramensoftware:main Jul 7, 2026
3 checks passed
@Anixx

Anixx commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Tray redirect does not work again, neither for sound, nor for network. It is enabled in Settings. Probably, it stops working when the Explorer restarts.

@Anixx

Anixx commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Yep, the redirect stops working when the Explorer is restarted, to make it to work again I have to restart the mod. On reboot or relogon it stops working again.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

Yep, the redirect stops working when the Explorer is restarted, to make it to work again I have to restart the mod. On reboot or relogon it stops working again.

Could you send the logs for a more accurate analysis? I've just tried and I don't seem to have this issue

@Anixx

Anixx commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

The log is empty when the redirect does not work.

For instance, I just restarted explorer, the sound redirect works, with log, but network redirect does not and shows no log.

@babamohammed2022

Copy link
Copy Markdown
Contributor Author

The log is empty when the redirect does not work.

For instance, I just restarted explorer, the sound redirect works, with log, but network redirect does not and shows no log.

I've tried to fix this issue. Please try it in this PR: #4727 and tell me if it works

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.

3 participants