Possible to kill "not responding" apps?
I've mentioned about SuperF4 not being able to kill the unresponsive app, forcing us to launch Task Manager to kill this process. https://github.com/stefansundin/superf4/issues/38
AltSnap can't do it too, I tried Ctrl+Alt+F4 or Alt+(Left/Middle/Right)MouseButton as "Kill program", does nothing...
Would it be possible to terminate the unresponsive app process without Task Manager?
Which version of Windows are you using? are-you running AltSnap Elevated?
Well now I understand the problem, I will see what I can do. it seems quite hard because I cannot even get the handle to the window from the mouse cursor, so I am not sure it is even possible.
Currently, I'm on Windows 11 21H2, I always run AltSnap as admin.
I have an idea, try the Alt+Tab method. While holding down Alt, we can close the selected app by pressing Del. Maybe we can do that with Alt+Shift+Del to force close an app while Alt-Tabbing?
I have an idea, try the Alt+Tab method. While holding down Alt, we can close the selected app by pressing Del. Maybe we can do that with Alt+Shift+Del to force close an app while Alt-Tabbing?
This would be great but unfortunately, this requires integration into the Alt+Tab window manager and this can be done only by Microsoft. What AltDrag does is simply manipulate windows from the outside using conventional Windows API.
So what happens is that after 5 sec of unresponsiveness for an application the Explorer will hide the actual window and present a special Ghost window, that can be moved/minimized/closed by the user. So if you Use Ctrl+Alt+F4 before the 5 second delay, verything works as expected. If you wait for the ..Not responding sufix, at this poment it is no longer the real window but a ghost, so when you Press Ctrl+Alt+F4, AltSnap see an explorer window and does not terminate it because no one wants to terminate the explorer by accident.
Hence, I need to find a way to get the windows handle from the Ghost window information and the only thing I got is a modified window title...
PS: Normally as soon as those 5 secs elapses, A simple Alt+F4 should propose to terminate the program, so I am not sure what the point would be? AltSnap can still be used to terminate programs that are hung but not detected or not yet detected by Windows.
@Yarrio69 In The latest 1.49 release, as soon as a window is a "ghost" window, AltSnap sends the WM_CLOSE Message, and the end process confirmation dialog should appear. For me it works, tell me if it helps you.
Hmm, the dialog doesn't appear for me.

Does it appear when you hit the close button?
Could you show me the content of the "Identify window" option in [balckist tab] when the application is not responding. it should show something like: Untitled - Notepad (Not Responding)|Ghost
This is the case on WinXP/7, I do not have Win10 anymore and never got Win11
Yep, the hung app can be force closed by spamming the close button too. I'll setup Windows 7 VM and test it when I get a chance.

This is what it should appear right?

Thanks for the details, the only thing I did not expect is to see the WM_NCHITTEST to 0, I will see if this is the reason. EDIT: Yes the dialog you are showing should appear.
@RamonUnch I think I found the solution: https://winaero.com/kill-not-responding-tasks-windows-10/
We can terminate non-responding apps with taskkill.exe /F /FI "status eq NOT RESPONDING"
This terminates ALL non-responding apps it finds, it's not very common to have more than one hung apps at the same time.
Maybe it can be integrated into AltSnap and mapped to Ctrl+Shift+Alt+F4.
The problem is if this taskkill command is used with admin privilege, it also kills DWM if atleast one hung app is found, causing the screen to blackout for a second, so adding dwm.exe to Blacklist would prevent this.
For some reason, it sometimes terminates AltSnap too.

Interesting indeed.
The taskkill command is its own thing, it would not care about any blacklist, blacklist are internally handled by AltSnap.
A solution could be to launch this command line without elevation (it is should possible using CreateProcess())
Windows is using a very simple heuristics to determine if a process is hung or not and this is quite risky in my opinion to launch this command line even at non admin level. Of course risky only if you get some running processes with unsaved data.
I will see on how to implement this in AltSnap, it might come with a different keyboard shortcut or with a confirmation dialog...
In the meantime maybe you can simply create a desktop shortcut with the command line (like described on winaero) and configure the keyboard shortcut so that it triggers on Ctrl+Shift+Alt+F4 or something.
I mean this trick does not need AltSnap or any extra programs to be launched from a keyboard shortcut... Also the advantage of the desktop shortcut is to launch the command without admin privilege.
In case I was not clear on windows when you create a desktop shortcut you can setup a keyboard shortcut by pressing the correct key combo in the Shortcut key: field in the property sheet of the desktop shortcut.

Also even more important you can exclude some processes from the list with the IMAGENAME filter: According to the documentation, the IMAGENAME filter can be used to check for processes to include or exclude. Fo you could run instead:
taskkill.exe /F /FI "status eq NOT RESPONDING" /FI "IMAGENAME ne AltSnap.exe" /FI "IMAGENAME ne dwm.exe"
I could not test this, try by yourself. Add more processes if needed...
Yep, it works. The .lnk Shortcut Key method has a delay before executing a command, so I used AutoHotkey instead, it's more effective and instant. I guess that feature doesn't need to be added to AltSnap then. ¯\_(ツ)_/¯
Here's the AHK script
^+!F4::
Run, taskkill.exe
/F /FI "status eq NOT RESPONDING"
/FI "IMAGENAME ne AltSnap.exe"
/FI "IMAGENAME ne dwm.exe"
/FI "IMAGENAME ne explorer.exe"
,,hide
^ = Ctrl
+ = Shift
! = Alt
,,hide = Don't show cmd window
I will link this topic in the wiki and present your .ahk script.
HungWindowFromGhostWindow is the way. @RamonUnch
Nice find for an undocumente NT api, I will implement this.
Try with this build, it will use the HungWindowFromGhostWindow if it is ghosted
Yep, it works.
https://github.com/user-attachments/assets/04f2774f-dbf8-44f6-85dc-b2c0c9cf7ce0
It will be in next release then!
@RamonUnch There's another small thing that needs to be fixed: Terminating a hung app with a keyboard action works, but terminating it with a mouse action (Alt + Middle Click) doesn't work.