winsiderss / systeminformer

A free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware. Brought to you by Winsider Seminars & Solutions, Inc. @ http://www.windows-internals.com
https://systeminformer.sourceforge.io
MIT License
10.83k stars 1.38k forks source link

"Find Window" outline persists on Window when tabbing back to System Informer #1533

Closed leumasme closed 1 year ago

leumasme commented 1 year ago

Brief description of your issue

When using the "Find Window" Drag and Drop Tool and tabbing back to System Informer while the tool is still active, the selection outline may remain visible on a Window even after the tool is exited and the Window unselected

Steps to reproduce (optional)

Expected behavior (optional)

The Selection Outline should not remain on a window after the tool has ended.

Actual behavior (optional)

The Selection Outline remains on the window even after the tool has finished. Video:

https://user-images.githubusercontent.com/29953391/206912578-bdac7fac-8244-47ed-8ce5-6640fc723d50.mp4

Environment (optional)

OS: Windows 10
Version: System Informer 3.0.5578 (ccc890a)
dmex commented 1 year ago

I compared the find window implementation with the Find Window feature included with Visual Studio Spy++ (C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\spyxx.exe) and Find Window included with Process Explorer (https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer)

The implementation is very similar and all 3 tools have the same issue when targeting windows for applications using their own internal UI rendering that doesn't invalidate and redraw the window after mouse movement.

As a workaround you can resize the window to force the program to redraw and remove the artifacts. Fixing this is problematic because it would require capturing screenshots of the desktop (including personal information), swapping the screen with the screenshot image and drawing over the screenshot but capturing screenshots of the desktop+swapping the screen triggers most anti-virus software because historically this is what malware does to create fake logon dialogs and steal passwords.

There's not many applications using their own rendering so I think using the same implementation as Spy++ and Process Explorer causes less issues and is more reliable. When Microsoft updates their tools with screenshot support then we'll re-open the issue 👍

leumasme commented 1 year ago

I see, but why does this then only happen when exiting the find window tool in this specific way? If the find window tool ends on Explorer normally by just releasing the mouse while it's over it, this same thing does not happen.

dmex commented 1 year ago

why does this then only happen when exiting the find window tool in this specific way?

I think it's the new immersive alt-tab window included with recent Win10/11 dropping some window messages because the border resets when using the old win32 alt-tab window.

If the find window tool ends on Explorer normally

I've added a workaround to reset the state when capture changes that should reset the border when alt-tabbing.