mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
[PTRun][WindowWalker]Don't hang when closing an unresponsive window (#33167)
* add(windowWalkerComponents): added a "Responding" variable signifying if a process is responding or not * add(win32NativeMethod): added "SendMessageTimeout" method in the common Win32 namespace * refactor(windowWalkerWindow): added an implementation of the helper function for closing the window using the newly defined method refactor(windowWalkerWindow): added a thread to run, whenever "CloseThisWindow" is called * refactor(resultHelper): used localizable strings for printing the responding text add(resources): added "Not Responding" localizable text to the resources file * refactor(resultHelper): refactored the message in case of a "Not Responding" task * refactor(resultHelper): modified the formatting of the subtitle * refactor(window): refactored the helper function and removed the unnecessary variable * refactor(windowProcess): changed the variable name from "Responding" to "IsResponding" * add: added try-catch to isResponding getter
This commit is contained in:
@@ -81,6 +81,9 @@ namespace Wox.Plugin.Common.Win32
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int SendMessage(IntPtr hWnd, int msg, int wParam);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int SendMessageTimeout(IntPtr hWnd, uint msg, UIntPtr wParam, IntPtr lParam, int fuFlags, int uTimeout, out int lpdwResult);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool CloseHandle(IntPtr hObject);
|
||||
|
||||
Reference in New Issue
Block a user