Skip to content

Conversation

@easyatm
Copy link
Contributor

@easyatm easyatm commented Nov 23, 2025

2025-11-23 (v1.1.20251123)

  • Fixed window control to use ShowWindow instead of PostMessage for better compatibility with windows that have popups, such as Excel
  • 修复窗口控制,使用 ShowWindow 而非 PostMessage,以更好地兼容带有弹出窗口的窗口,如 Excel

Fixes:

Copilot AI review requested due to automatic review settings November 23, 2025 11:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) to ShowWindow(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.

Comment on lines +329 to +330
log("ShowOwnedPopups 0x{:x} false", (uintptr_t)rc.ownerWnd);
}
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +333 to +334
log("ShowWindow SC_MINIMIZE 0x{:x}", (uintptr_t)rc.wnd);

Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

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

This debugging log statement should be removed for production code. It adds unnecessary logging verbosity for normal operations.

Suggested change
log("ShowWindow SC_MINIMIZE 0x{:x}", (uintptr_t)rc.wnd);

Copilot uses AI. Check for mistakes.
"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",
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +12
"cwd": "e:/eProject/windhawk-mods/mods",
"program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug",
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
"cwd": "e:/eProject/windhawk-mods/mods",
"program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/build/Debug/outDebug",

Copilot uses AI. Check for mistakes.
"stopAtEntry": false,
"externalConsole": true,
"cwd": "e:/eProject/windhawk-mods/mods",
"program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug",
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
"program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug",
"program": "${workspaceFolder}/build/Debug/outDebug",

Copilot uses AI. Check for mistakes.
// 输出窗口信息
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,
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

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

Typo in log message: "Processing2" should be "Processing".

Suggested change
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,

Copilot uses AI. Check for mistakes.
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);
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
log("hWnd:0x{:x}", (uintptr_t)hWndCcc);

Copilot uses AI. Check for mistakes.
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.

1 participant