Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{

Check warning on line 1 in .vscode/c_cpp_properties.json

View workflow job for this annotation

GitHub Actions / Test changed files

File is not placed in the mods folder

Check warning on line 1 in .vscode/c_cpp_properties.json

View workflow job for this annotation

GitHub Actions / Test changed files

Filename should end with .wh.cpp

Check warning on line 1 in .vscode/c_cpp_properties.json

View workflow job for this annotation

GitHub Actions / Test changed files

Missing @‌author

Check warning on line 1 in .vscode/c_cpp_properties.json

View workflow job for this annotation

GitHub Actions / Test changed files

Missing @‌name

Check warning on line 1 in .vscode/c_cpp_properties.json

View workflow job for this annotation

GitHub Actions / Test changed files

Missing @‌version

Check warning on line 1 in .vscode/c_cpp_properties.json

View workflow job for this annotation

GitHub Actions / Test changed files

Missing @‌id

Check warning on line 1 in .vscode/c_cpp_properties.json

View workflow job for this annotation

GitHub Actions / Test changed files

Missing @‌github

Check warning on line 1 in .vscode/c_cpp_properties.json

View workflow job for this annotation

GitHub Actions / Test changed files

Must be one added or one modified file, got added_count=3 modified_count=1 all_count=4
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "gcc",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{

Check warning on line 1 in .vscode/launch.json

View workflow job for this annotation

GitHub Actions / Test changed files

Missing @‌id

Check warning on line 1 in .vscode/launch.json

View workflow job for this annotation

GitHub Actions / Test changed files

Missing @‌github
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "e:/eProject/windhawk-mods/mods",
"program": "e:/eProject/windhawk-mods/mods/build/Debug/outDebug",
Comment on lines +11 to +12
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.
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.
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
59 changes: 59 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"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.
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
30 changes: 22 additions & 8 deletions mods/win-d-per-monitor.wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @name Win+D per monitor(show desktop)
// @description Press Win+D to only manage the windows on the monitor where the mouse is located.
// @description:zh-CN 按下Win+D时 只最小化/还原鼠标所在显示器的窗口
// @version 1.1.20250811
// @version 1.1.20251123
// @author easyatm
// @github https://github.com/easyatm
// @include explorer.exe
Expand Down Expand Up @@ -35,6 +35,13 @@ where the mouse cursor is located.

## Changelog

### 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:
- https://github.com/ramensoftware/windhawk-mods/issues/2709

### 2025-08-11 (v1.1.20250811)
- Added option to ignore topmost tool windows without title bar during Win+D operation
- 新增忽略置顶且无标题栏的工具窗口选项,在Win+D操作时保持这类窗口可见
Expand Down Expand Up @@ -78,7 +85,8 @@ using namespace std;
#define log(...) Wh_Log(L"%s", ansi_unicode(format(__VA_ARGS__)).c_str());

// 设置变量
struct {
struct
{
bool ignoreTopmostNoTitleBarWindows;
int minWindowSize;
} g_settings;
Expand Down Expand Up @@ -283,9 +291,10 @@ class WindShowDesktop
GetWindowTextA(hWndCcc, windowTitle, sizeof(windowTitle));

// 输出窗口信息
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.
(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.
vec.push_back({ hWndCcc, wndClass, ownerWnd });
}
return vec;
Expand Down Expand Up @@ -315,11 +324,16 @@ class WindShowDesktop
continue;

if (rc.ownerWnd)
{
ShowOwnedPopups(rc.ownerWnd, false);
log("ShowOwnedPopups 0x{:x} false", (uintptr_t)rc.ownerWnd);
}
Comment on lines +329 to +330
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.
else
{
//::ShowWindow(rc.wnd, SW_MINIMIZE);
PostMessage(rc.wnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
log("ShowWindow SC_MINIMIZE 0x{:x}", (uintptr_t)rc.wnd);

Comment on lines +333 to +334
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.
::ShowWindow(rc.wnd, SW_MINIMIZE);
//PostMessage(rc.wnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
}

listWnd.emplace_back(std::move(rc));
Expand All @@ -344,8 +358,8 @@ class WindShowDesktop
}
else
{
//::ShowWindow(rc.wnd, SW_SHOWNOACTIVATE);
PostMessage(rc.wnd, WM_SYSCOMMAND, SC_RESTORE, 0);
::ShowWindow(rc.wnd, SW_SHOWNOACTIVATE);
//PostMessage(rc.wnd, WM_SYSCOMMAND, SC_RESTORE, 0);
hLastWnd = rc.wnd;
}

Expand Down
Loading