Skip to content

Commit f70ae41

Browse files
committed
Issues #131 Issues #168 Attempt to fix the performance issue
1 parent 1fb11aa commit f70ae41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SmartSystemMenuHook/SmartSystemMenuHook.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static LRESULT CALLBACK CbtHookCallback(int code, WPARAM wparam, LPARAM lparam)
7575
else if (code == HCBT_ACTIVATE)
7676
msg = WM_SSM_HOOK_HCBT_ACTIVATE;
7777

78-
if (msg != 0)
78+
if (msg != 0 && GetSystemMenu((HWND)wparam, false) != NULL)
7979
{
8080
SendNotifyMessage(hwndMain, msg, wparam, lparam);
8181
}
@@ -116,7 +116,7 @@ static LRESULT CALLBACK ShellHookCallback(int code, WPARAM wparam, LPARAM lparam
116116
else if (code == HSHELL_WINDOWDESTROYED)
117117
msg = WM_SSM_HOOK_HSHELL_WINDOWDESTROYED;
118118

119-
if (msg != 0)
119+
if (msg != 0 && GetSystemMenu((HWND)wparam, false) != NULL)
120120
{
121121
SendNotifyMessage(hwndMain, msg, wparam, lparam);
122122
}

0 commit comments

Comments
 (0)