diff --git a/2.x/trunk/CHANGELOG.txt b/2.x/trunk/CHANGELOG.txt index 87fd2b42f..ce6b14fa8 100644 --- a/2.x/trunk/CHANGELOG.txt +++ b/2.x/trunk/CHANGELOG.txt @@ -8,6 +8,8 @@ Process Hacker * Hide Processes From Other Users and Hide Signed Processes settings are now saved * Font selection on Windows XP + * ToolStatus plugin: Always on Top status being reset by + Find Window 2.13 * NEW/IMPROVED: diff --git a/2.x/trunk/plugins/ToolStatus/CHANGELOG.txt b/2.x/trunk/plugins/ToolStatus/CHANGELOG.txt index 383b70e24..313029c5c 100644 --- a/2.x/trunk/plugins/ToolStatus/CHANGELOG.txt +++ b/2.x/trunk/plugins/ToolStatus/CHANGELOG.txt @@ -1,3 +1,7 @@ +1.6 + * Fixed Always on Top being reset when using Find Window + * Fixed Esc key when using Find Window + 1.5 * Added Find Window and Kill diff --git a/2.x/trunk/plugins/ToolStatus/ToolStatus.rc b/2.x/trunk/plugins/ToolStatus/ToolStatus.rc index 4127dc44f..617cb41c1 100644 --- a/2.x/trunk/plugins/ToolStatus/ToolStatus.rc +++ b/2.x/trunk/plugins/ToolStatus/ToolStatus.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,5,0,0 - PRODUCTVERSION 1,5,0,0 + FILEVERSION 1,6,0,0 + PRODUCTVERSION 1,6,0,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "wj32" VALUE "FileDescription", "ToolStatus plugin for Process Hacker" - VALUE "FileVersion", "1.5" + VALUE "FileVersion", "1.6" VALUE "InternalName", "ToolStatus" VALUE "LegalCopyright", "Licensed under the GNU GPL, v3." VALUE "OriginalFilename", "ToolStatus.dll" VALUE "ProductName", "ToolStatus plugin for Process Hacker" - VALUE "ProductVersion", "1.5" + VALUE "ProductVersion", "1.6" END END BLOCK "VarFileInfo" diff --git a/2.x/trunk/plugins/ToolStatus/main.c b/2.x/trunk/plugins/ToolStatus/main.c index 66c9a0736..b23f456f2 100644 --- a/2.x/trunk/plugins/ToolStatus/main.c +++ b/2.x/trunk/plugins/ToolStatus/main.c @@ -57,6 +57,7 @@ ULONG ToolBarIdRangeEnd; BOOLEAN TargetingWindow = FALSE; HWND TargetingCurrentWindow = NULL; BOOLEAN TargetingCurrentWindowDraw = FALSE; +BOOLEAN TargetingCompleted = FALSE; ULONG TargetingMode; ULONG ProcessesUpdatedCount = 0; @@ -344,6 +345,16 @@ LRESULT CALLBACK MainWndSubclassProc( goto DefaultWndProc; } + + // If we're targeting and the user presses the Esc key, cancel the targeting. + // We also make sure the window doesn't get closed by filtering out the message. + if (LOWORD(wParam) == PHAPP_ID_ESC_EXIT && TargetingWindow) + { + TargetingWindow = FALSE; + ReleaseCapture(); + + goto DefaultWndProc; + } } break; case WM_NOTIFY: @@ -371,6 +382,7 @@ LRESULT CALLBACK MainWndSubclassProc( TargetingWindow = TRUE; TargetingCurrentWindow = NULL; TargetingCurrentWindowDraw = FALSE; + TargetingCompleted = FALSE; switch (id) { @@ -463,7 +475,12 @@ LRESULT CALLBACK MainWndSubclassProc( ULONG processId; ULONG threadId; - BringWindowToTop(hWnd); + TargetingCompleted = TRUE; + + // Bring the window back to the top, and preserve the Always on Top setting. + SetWindowPos(PhMainWndHandle, PhGetIntegerSetting(L"MainWindowAlwaysOnTop") ? HWND_TOPMOST : HWND_TOP, + 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); + TargetingWindow = FALSE; ReleaseCapture(); @@ -560,6 +577,29 @@ LRESULT CALLBACK MainWndSubclassProc( } } break; + case WM_CAPTURECHANGED: + { + if (!TargetingCompleted) + { + // The user cancelled the targeting, probably by pressing the Esc key. + + // Remove the border on the currently selected window. + if (TargetingCurrentWindow) + { + if (TargetingCurrentWindowDraw) + { + // Remove the border on the window we found. + DrawWindowBorderForTargeting(TargetingCurrentWindow); + } + } + + SetWindowPos(PhMainWndHandle, PhGetIntegerSetting(L"MainWindowAlwaysOnTop") ? HWND_TOPMOST : HWND_TOP, + 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); + + TargetingCompleted = TRUE; + } + } + break; case WM_SIZE: { RECT padding;