* fixed Always on Top being reset when using Find Window

* fixed Esc key when using Find Window

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@4144 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2011-03-18 06:26:56 +00:00
parent 287a492a4c
commit 3b38845fd2
4 changed files with 51 additions and 5 deletions
+2
View File
@@ -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:
@@ -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
+4 -4
View File
@@ -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"
+41 -1
View File
@@ -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;