Fixes bug#2729
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the Win+D per monitor functionality by replacing PostMessage with ShowWindow API calls for better compatibility with applications that have popup windows, specifically addressing issues with Excel.
- Changed window minimization/restoration from
PostMessage(WM_SYSCOMMAND, SC_MINIMIZE/SC_RESTORE)toShowWindow(SW_MINIMIZE/SW_SHOWNOACTIVATE) - Updated version number and changelog documentation
- Added VSCode IDE configuration files (with environment-specific settings that should be reviewed)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| mods/win-d-per-monitor.wh.cpp | Core bug fix: replaced PostMessage with ShowWindow API for window control; added debug logging; updated version and changelog |
| .vscode/settings.json | Added C/C++ Runner configuration with hardcoded local paths |
| .vscode/launch.json | Added debug configuration with hardcoded local paths |
| .vscode/c_cpp_properties.json | Added IntelliSense configuration for Windows GCC |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| log("ShowOwnedPopups 0x{:x} false", (uintptr_t)rc.ownerWnd); | ||
| } |
There was a problem hiding this comment.
These debugging log statements appear to have been added during development and should be removed or reduced in verbosity for production code. They add excessive logging noise for normal operations.
| log("ShowWindow SC_MINIMIZE 0x{:x}", (uintptr_t)rc.wnd); | ||
|
|
There was a problem hiding this comment.
This debugging log statement should be removed for production code. It adds unnecessary logging verbosity for normal operations.
| log("ShowWindow SC_MINIMIZE 0x{:x}", (uintptr_t)rc.wnd); |
| "C_Cpp_Runner.debuggerPath": "gdb", | ||
| "C_Cpp_Runner.cStandard": "", | ||
| "C_Cpp_Runner.cppStandard": "", | ||
| "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", |
There was a problem hiding this comment.
This hardcoded path "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat" appears to be specific to your local development environment and should not be committed to the repository. The path contains what looks like a placeholder or version number "VR_NR" that won't exist on other developers' machines. Consider adding .vscode/ to .gitignore or use workspace-relative paths instead.
| "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", |
| "cwd": "e:/eProject/windhawk-mods/mods", | ||
| "program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug", |
There was a problem hiding this comment.
This hardcoded absolute path "e:/eProject/windhawk-mods/mods" is specific to your local development environment and should not be committed to the repository. This will not work for other developers who clone the repository. Consider adding .vscode/ to .gitignore or use workspace-relative paths like ${workspaceFolder} instead.
| "cwd": "e:/eProject/windhawk-mods/mods", | |
| "program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug", | |
| "cwd": "${workspaceFolder}", | |
| "program": "${workspaceFolder}/build/Debug/outDebug", |
| "stopAtEntry": false, | ||
| "externalConsole": true, | ||
| "cwd": "e:/eProject/windhawk-mods/mods", | ||
| "program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug", |
There was a problem hiding this comment.
This hardcoded absolute path "e:/eProject/windhawk-mods/mods/build/Debug/outDebug" is specific to your local development environment and should not be committed to the repository. This will not work for other developers who clone the repository. Consider adding .vscode/ to .gitignore or use workspace-relative paths like ${workspaceFolder} instead.
| "program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug", | |
| "program": "${workspaceFolder}/build/Debug/outDebug", |
| // 输出窗口信息 | ||
| log("Processing window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", | ||
| wndClass, windowTitle, width, height, (uintptr_t)hWndCcc, (uintptr_t)ownerWnd); | ||
| log("Processing2 window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", wndClass, windowTitle, width, height, |
There was a problem hiding this comment.
Typo in log message: "Processing2" should be "Processing".
| log("Processing2 window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", wndClass, windowTitle, width, height, | |
| log("Processing window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", wndClass, windowTitle, width, height, |
| log("Processing2 window: class='{}', title='{}', size={}x{}, hwnd=0x{:x}, owner=0x{:x}", wndClass, windowTitle, width, height, | ||
| (uintptr_t)hWndCcc, (uintptr_t)ownerWnd); | ||
|
|
||
| log("hWnd:0x{:x}", (uintptr_t)hWndCcc); |
There was a problem hiding this comment.
This appears to be a debugging log statement that was added during development and should likely be removed before merging to production. It duplicates information already logged in the "Processing" log statement above and doesn't add meaningful value.
| log("hWnd:0x{:x}", (uintptr_t)hWndCcc); |
- Fixed window control to use ShowWindow instead of PostMessage for better compatibility with windows that have popups, such as Excel - 修复窗口控制,使用 ShowWindow 而非 PostMessage,以更好地兼容带有弹出窗口的窗口,如 Excel
2025-11-23 (v1.1.20251123)
Fixes: