Terminate program that has taken over the screen

128,396

Solution 1

Use AutoHotKey and bind a shortcut to WinKill, A

This command first makes a brief attempt to close the window normally. If that fails, it will attempt to force the window closed by terminating its process.

WinTitle: If this is the letter A and the other 3 window parameters are blank or omitted, the active window will be used.


I compiled this one-liner to an .EXE which you can download here.

#!Q::WinKill,A
  • Move KillActiveWindow.exe to your autostart folder. It will reside in your Windows tray.
  • Close active windows/full-screen applications with Win+Alt+Q.

enter image description here

Solution 2

If you're using Windows 10, you can switch to another desktop using Win+Tab and then open the task manager in desktop 2 to kill the full screen application in desktop 1. This works even if the application is set to stay-on-top.

Solution 3

This happened to me today on Windows 10 when the Snipping Tool froze while making the capture selection. I was able to get the Task Manager to show up by the following:

  • Press the Windows key, then type Task Manager + Enter to open the Task Manager
  • Press the Windows key again to get the Taskbar in focus
  • Right click the system tray icon for the Task Manager and select "Always on top"

Solution 4

Try using command prompt.

You can kill tasks using command prompt just like Linux terminal.

  1. Windows Key+R (Run)

  2. type 'cmd' and click enter

  3. type the command tasklist, press enter. you can see all tasks running in your system.

  4. kill particular task/application by taskkill /f /im taskname

E.g.: If you want to kill notepad, type taskkill /f /im notepad.exe

Solution 5

If task manager won't come to the front, it's possible "always on top" is unchecked.

Ctrl+Shift+Esc to bring it open, hit Alt, and you should see the file menu of the task manager appear. Press to go to options, to select always on top, and Space to enable it.

Share:
128,396

Related videos on Youtube

AStupidNoob
Author by

AStupidNoob

Updated on September 18, 2022

Comments

  • AStupidNoob
    AStupidNoob almost 2 years

    I've been using Windows forever, but one thing that has annoyed me is how hard it is to terminate misbehaving full-screen applications. In Linux, I can just switch over to terminal (Ctrl+Alt+F1) and use the terminal to forcefully close a misbehaving program. In Windows, this seems to be only possible using task manager. If a frozen window is set to stay-on-top and full-screen mode, Alt+Tab and Alt+F4 don't work and I can't even use the Task Manager. If I had important work in the background, say, and I'd forgotten to save it, I can't just restart the computer!

    What do you do in this circumstance?

    • nixda
      nixda almost 11 years
      You say that even CTRL+SHIFT+ESC doesn't bring task manager to foreground in your scenario?
    • Austin T French
      Austin T French almost 11 years
      That should be taskmanager's default behavior.
    • Ramhound
      Ramhound almost 11 years
      @AStupidNoob - Your complaint was how hard it was to terminate a process in Windows. But to be fair the behavior you describe if it happen on Linux would be duplicate, you wouldn't be able to see the terminal windows, and thus wouldn't be able to terminate the process. Its not normal for a process to do what you describe figure out the reason its doing that and prevent it. CTRL+F4 will kill a process, but if that doesn't work, then there something else going on. As already suggest you can use the command prompt to kill a process.
    • Philipp Horn
      Philipp Horn almost 11 years
      @Ramhound I think Ctrl+Alt+F1 on Linux would help because it switches from the GUI to your first text based terminal; you would get away from the (frozen) window manager so you wouldn't have a "terminal window"...just a "terminal" :)
    • AStupidNoob
      AStupidNoob almost 11 years
      @Ramhound On Linux, Control + Alt + F1 goes to a terminal no matter what the GUI is doing, it's entirely separate. Also ALT + F4 right, not Control + F4...
    • Ramhound
      Ramhound almost 11 years
      @PhilippHorn - I still maintain that the original complaint is invalid, while Windows does handle command prompts differently, the real problem being experience can be solved.
    • martinstoeckli
      martinstoeckli over 8 years
      <CTRL><ALT><Delete> should get you out of everything, the menu should allow to open the taskmanager or switching to other applications.
    • Uğur Gümüşhan
      Uğur Gümüşhan over 7 years
      click on the program window several times, windows will ask you if you want to end the unresponsive process, then click end
    • PascalIv
      PascalIv over 3 years
      I can't answer here because I am missing reputation, but the simple solution is to close the task manager with windows key, right click on it if its open, close. Then "windows key + TAB" and add a new desktop, open a new task manager on the new desktop and kill the fullscreen program.
  • AStupidNoob
    AStupidNoob almost 11 years
    I'm aware of this, but if the window has taken over the whole screen, you can't see anything or switch windows. Maybe the run terminal would still accept input. It's hard to crash a program on purpose to test this.
  • AStupidNoob
    AStupidNoob almost 11 years
    I didn't try that, but maybe that would have worked. I'll keep it in mind next time something crashes, thanks.
  • Hugo Zink
    Hugo Zink over 8 years
    @AStupidNoob If you go to C:/Windows/System32, you can rename sethc.exe, copy cmd.exe, and rename the copy to sethc.exe. Now you can go into the CTRL+ALT+DEL menu and press shift 5 times to open the command prompt. Should work even if an application is completely stuck in the foreground.
  • xaxxon
    xaxxon almost 8 years
    win-d didn't do anything. Of course you can't pull up a command prompt either. This usually happens when full-screen graphics applications hang.
  • Vlad
    Vlad over 7 years
    No need for context menu, you can just press delete -> enter
  • Hugo Zink
    Hugo Zink over 7 years
    Unfortunately this does not always seem to stop misbehaving programs. For example, when used in Notepad, Windows will still prompt and ask if you want to save your changes. Is there any way to force-kill a process as if done through task manager?
  • Protector one
    Protector one over 7 years
    Cool! I find that on Windows 10, delete is enough. I updated my answer.
  • Scott - Слава Україні
    Scott - Слава Україні about 7 years
    Are you suggesting that the user should keep the Task Manager on screen, on top, all the time?  That can be detrimental to the user experience. Are you suggesting that setting the "Always On Top" option will improve Task Manager's ability to respond when a full-screen application misbehaves?  That seems dubious. Have you ever actually observed such behavior?
  • pauloz1890
    pauloz1890 almost 7 years
    Legend! This really saved me today from losing work! Clicking "Always on top" was the only way I could get task manager to show up and end the snipping tool.
  • user598527
    user598527 over 6 years
    This doesn't universally work, potentially when operating system is non-responsive. I reproduced with "Star Wars: Battlefront II" (2017) beta. The hotkey works fine otherwise.
  • user598527
    user598527 over 6 years
    Task manager can't always be opened.
  • Hugo Zink
    Hugo Zink over 6 years
    After some further inspection, it seems that WinKill will first wait for the window to close itself briefly, and then kill the process. But quite often, the crashed game will still act as if it's responding, which makes AutoHotkey not kill the process. Is there any way to override this behavior?
  • Laurie Stearn
    Laurie Stearn over 6 years
    Might be if testing programs with a large draw on the GDI- we trust in this day & age it doesn't come to that, however.
  • Aaron
    Aaron over 6 years
    Best answer in the thread. I had a game (They Are Billions) lock up hard and the usual ctrl+shift+esc to bring up Task Manager wasn't working; nothing was viewable outside the task bar. Create a new desktop and bringing up Task Manager there to End Task did the trick!
  • Whelkaholism
    Whelkaholism about 6 years
    I just had a Snipping Tool crash that left every single desktop obscured by the Snipping Tool selection overlay; this is the ONLY one of these answers that saved my bacon :) So yes, in at least this case, it very much does improve Task Manager's ability to respond.
  • Biswapriyo
    Biswapriyo about 6 years
    Explain your answer. It would be helpful for readers. like what the command means, command syntax etc.
  • Ramhound
    Ramhound almost 6 years
    This was posted as an answer, but it does not attempt to answer the question. It should possibly be an edit, a comment, another question, or deleted altogether.
  • NetherGranite
    NetherGranite over 5 years
    Thanks, this is the only one that worked for me.
  • Shayan
    Shayan over 5 years
    @HugoZink Instead of using WinKill you should use Process, see my answer.
  • Local Needs
    Local Needs over 4 years
    Same here. Nothing else mentioned on this thread worked. I even tried running the Switch User routine. Once I got the TM to appear and killed the process, all came back to life. Such a weird issue...
  • Corrodias
    Corrodias over 4 years
    @user598527 If the operating system is non-responsive, then there are, by definition, no options other than a hardware reset or power off; no software solution will help you.
  • Isaaс Weisberg
    Isaaс Weisberg almost 4 years
    dude, I sincerely hope that they pay you well at your workplace
  • pacoverflow
    pacoverflow about 3 years
    THANK YOU!!! THIS answer worked when none of the others did. I was typing blind because the Snipping Tool wouldn't let me see anything.