The window you can't close is almost never one problem, so the honest answer is conditional. If it's a browser tab or pop-up, press Alt+F4 on Windows or Command+W on a Mac, and use the browser's own task manager when that fails. If a program has frozen, End Task from Task Manager or Force Quit on macOS. If a dialog box won't budge, try Esc, then Enter, then the system-level kill.
The single most common cause is a modal dialog or a page script holding the window open. One narrower case matters more than the rest: a window with no title bar and no close button is usually full-screen mode (F11 on Windows, Control+Command+F on a Mac), where the button isn't missing β it's hidden. Work through the methods below in order; each one is a step further from the normal close action and a step closer to the operating system.
Start with the five-second checks before anything drastic
Before you reach for Task Manager, rule out the three ordinary reasons a window won't close, because each one is fixed in under five seconds and none of them requires force-quitting anything. Press Esc first; it dismisses most dialog boxes, dropdown menus, and search overlays that sit invisibly on top of a window and capture your clicks. Then press Alt+F4 once more, but click the window first so it has keyboard focus β a close command sent to the wrong window does nothing at all.
Full-screen mode is the most misread situation. When a browser or video player runs full-screen, the title bar and the close button disappear by design, not by fault. Tap F11 in a browser on Windows or hover near the top edge on a Mac to reveal the traffic-light buttons, then close normally. If you're in a presentation or a game, Esc exits full-screen first.
A dialog box waiting on an answer also blocks closing. Look for a smaller window layered on top asking for a save, a confirmation, or a permission, and answer it. On Windows, Alt+Tab shows every open window, including that hidden dialog, and Alt+Space opens the window's system menu where you'll find Close as a menu item when the title-bar button is out of reach.
One more check costs nothing: some windows are minimized to the taskbar and appear closed. Click the taskbar icon on Windows or the Dock icon on a Mac to bring the window back, then close it for real. Only after these five checks fail should you move to the next method.
Close a browser tab or pop-up that refuses to go
For browser windows, start with the keyboard shortcut for the platform, then escalate to the browser's own task manager, which is a feature most people never open. On Windows and Linux, Control+W closes the current tab and Alt+F4 closes the whole browser window; on a Mac, Command+W closes the tab and Command+Shift+W closes the window. If the tab stays put, right-click it and choose Close Tab, or middle-click it with the mouse wheel.
Pop-ups are trickier because a badly behaved script can re-open them the moment you close one. Chrome, Edge, and Firefox each ship a built-in task manager that kills a single tab or extension without restarting the browser. In Chrome, open the three-dot menu, go to More Tools, then Task Manager; in Edge, it's the same path under More Tools; in Firefox, open the menu and choose Task Manager. Select the row for the stuck tab and click End Process.
If the pop-up keeps returning, block the source rather than fighting the symptom. Each browser has a site-settings page for pop-ups and redirects where you can add the offending domain to the block list; Chrome and Edge both expose this under Settings, then Privacy and Search, then Site Settings. Clearing the site's cookies and cached data also breaks the script loop that reopens it.
One modern caveat: a site installed as a Progressive Web App runs in its own window that looks like a native app. Closing the tab does nothing because there's no tab. Use the app's own menu, or Alt+F4 on Windows and Command+Q on the Mac, to quit the whole app window. If that fails, treat it like a frozen program in the next section.
Force a frozen program to quit on Windows
When a program is genuinely hung, the operating system can end it even though the program can't end itself, and Windows gives you three tools in ascending order of force. Start with Task Manager: press Control+Shift+Esc, find the entry under the Processes tab, click it, and choose End task. Windows 11 and Windows 10 both label the button End task; Windows 7 called it End process, which is why older guides use that phrase.
If Task Manager itself is slow or the process returns, open the Details tab and end the underlying executable, which often has a different name than the friendly process label β a browser process may appear as the browser's helper executable rather than the brand name. For a process that even Task Manager can't kill, open Command Prompt as administrator and run taskkill /IM program.exe /F, substituting the real executable name; the /F flag forces termination and /IM matches by image name. To kill everything at once, taskkill /F /FI "STATUS eq NOT RESPONDING" ends every hung program in one command.
The escalation you should know about is the difference between signing out and restarting. Signing out of Windows closes every program and returns you to the login screen without a full reboot, which clears a hung process in roughly 20 seconds on a modern machine. A restart takes longer but repairs stuck system services too. Shut down only if sign-out and restart both fail.
What you should not do is hold the power button immediately. A hard power-off can interrupt a disk write and corrupt open files, particularly in applications that save to a database or an open document. Use it as the last resort after Task Manager, the command line, and sign-out have all failed.
Quit an unresponsive app on a Mac
macOS handles a hung app differently from Windows, and the shortcut you reach for first depends on whether the whole system is responsive. Press Command+Option+Esc to open the Force Quit dialog, select the app, and click Force Quit β the dialog lists only apps that are currently running, so a frozen app always appears there even when its window is buried. Option+Command+Shift+Esc is the one-step version that force-quits the frontmost app instantly.
For a single stuck window rather than the whole app, macOS has a dedicated command: with the window active, hold Shift and click the red close button, or press Command+Option+Shift+W. This closes the one window without quitting the app. To close every window of the front app at once, press Command+Option+W.
If the Finder is also frozen, the Force Quit dialog may not appear at all. In that case, click the Apple menu and choose Force Quit, then relaunch the Finder from the same dialog, or hold Command+Option+Shift+Esc for three seconds to force-quit the Finder directly. That resets the desktop without restarting the Mac.
For a truly wedged machine, hold the power button on Apple silicon Macs until the screen goes black, or on older Intel Macs hold Control+Command+Power. Before that, try Apple menu, then Log Out, which closes every app gracefully and catches files the force-quit would have lost. On a Mac that runs a third-party window manager or accessibility tool, a stuck window can also be caused by that helper; quitting the helper from Activity Monitor is the next check.
Handle dialog boxes, modal loops, and windows with no close button
A window that never shows a close button is usually not broken β it's a modal dialog waiting for input, and the operating system is deliberately refusing to let it close until you answer. The fix is to give it the answer it wants: try Enter for the default button, Tab then Space to reach a different option, and Esc for Cancel. If the buttons are greyed out, look for a required checkbox or text field that the dialog is waiting on.
On Windows, if a dialog has no visible close button, right-click its title bar and choose Close from the context menu, or press Alt+Space to open the same menu. In some cases the dialog has been dragged off-screen and the title bar is out of reach; with the dialog focused, press Alt+Space, then M for Move, then use the arrow keys to bring it back into view before pressing Enter.
A modal loop β a dialog that reopens the moment you dismiss it β points to an underlying process rather than the window itself. Open the browser's or the app's own task manager, find the entry re-creating the dialog, and end it. If the dialog belongs to a system process, sign out and back in; the modal loop lives in that process's memory and ends with it.
On macOS, a sheet attached to a window can appear to have no controls until you supply a filename or confirm a setting. Look for the sheet's own Cancel or Don't Save button at the edge of the parent window, and don't confuse the distraction of a second sheet behind it. If the controls are disabled, cancel the parent operation rather than the sheet.
Kill a window when the mouse and menus both stop working
| Situation | Windows command | macOS command | What it clears |
|---|---|---|---|
| One hung program | Task Manager β End task, or taskkill /IM program.exe /F | Command+Option+Esc β Force Quit | The app's process only |
| One stuck browser tab | Browser Task Manager β End Process | Chrome menu β Task Manager β End Process | That tab or extension |
| Entire desktop frozen | Control+Shift+Esc (fallback: Control+Alt+Delete) | Command+Option+Shift+Esc for 3 seconds | The shell, while apps keep running |
| Everything hangs | Sign out, then restart | Log out, then restart | All user processes |
The table above maps four situations to four different tools. The Windows shell and the Mac Finder are the pieces that draw the taskbar, the Dock, and window controls; restarting the shell fixes a frozen desktop while leaving other apps running, and it takes a few seconds. On Windows, if Task Manager won't open at all, press Control+Alt+Delete and choose Task Manager from the security screen, which loads in a separate context from the desktop.
The command-line route works when the graphical tools won't. On Windows, the taskkill command from an elevated Command Prompt reaches any process the user account owns, regardless of what the desktop is doing. On macOS, open Terminal and run killall -9 followed by the app's process name; the -9 flag sends the termination signal the app can't ignore, while a plain killall asks politely first and sometimes succeeds where Force Quit didn't.
What none of these tools can do is close a window owned by another user session. A dialog from an administrator's session, or a service window from a background process, belongs to a different account and will not appear in your Task Manager. Switch to that user or ask the administrator; on Windows, signing out your own session leaves the other user's session untouched.
If a single program refuses to quit across every method, the next suspect is malware or a corrupted installation rather than the window itself. Run the operating system's built-in scanner β Microsoft Defender on Windows, or a reputable scanner on the Mac β and reinstall the program. That is a different diagnosis from a frozen window, and it's worth naming so you don't repeat the same kill command indefinitely.
Stop a pop-up or redirect that reopens after every close
A pop-up that comes back after every close is driven by a script, an extension, or a redirect, and each has its own fix. Start with the extension: open the browser's extension manager, disable everything, and reload the page. If the window stays closed, re-enable extensions one at a time until it returns; the last one you turned on is the culprit, and removing it ends the loop. In Chrome and Edge, open the menu, go to Extensions, then Manage Extensions; Firefox uses Add-ons and Themes.
If no extension is responsible, the site itself is running the loop. Open the site's permissions page and block pop-ups and redirects for that domain, then clear the site's cookies and site data. Many re-open scripts key off a cookie or a cached script file, so clearing both removes the trigger. A tab that spawns a new window on every close is usually a known ad-network pattern, and blocking the site outright is the shorter path.
Some pop-ups are actually notifications from the browser, not windows at all, and closing them refreshes the badge until the site is muted. On Windows 11 and Windows 10, the notification behavior is controlled in Settings, under System, then Notifications, plus a per-site switch in the browser's site settings. On a Mac, System Settings, then Notifications, holds the same per-app controls. Turn off the site's notification permission rather than clicking the pop-up away.
One symptom worth recognizing: a window that reappears inside the same tab with a new address each time is a redirect chain, not a pop-up. Use the browser's back button or history to leave the chain, and if the address bar is controlled by a script, close the tab rather than the window. Reopening the site later will reset the chain only if the offending bookmark or link is removed first.
What to do when the whole desktop or both browsers lock up
When every window is unresponsive, the problem sits above the individual app, and the tools you reach for change. On Windows, try Control+Shift+Esc for Task Manager, and if that fails, Control+Alt+Delete opens the security screen, which runs independently of the desktop. From there, sign out; every program closes, unsaved work is lost, and you're back at the login prompt in under a minute on a modern machine. Sign out before you shut down, because the sign-out path flushes user files and clears the hung session without a full reboot.
A desktop that refuses even the security screen needs a hard restart, and the cost is time and risk rather than money. Hold the power button for five to ten seconds on a desktop, or until the screen blanks on a laptop, then power back on. Before you do, note that any open document not recently saved will be lost, and a database-backed app can leave a recovered file on the next launch. Save first if the Save dialog responds.
On a Mac, Command+Option+Esc should appear even when the desktop looks dead; if it doesn't, hold the power button on Apple silicon, or Control+Command+Power on older Intel models, until the machine restarts. The Apple menu's Restart item is the gentler path when the menu bar still responds, and the Mac will prompt you to reopen windows afterward, which is a genuine convenience, not a guarantee that unsaved work comes back.
The repair angle you rarely read in shortcut guides: if the same app freezes every day at roughly the same time, the window isn't the problem. Check for an automatic update, a scheduled backup, or a syncing service running at that hour, and narrow the schedule. Reinstalling the app and updating the operating system addresses corrupted components; a persistent pattern across every app points to storage or heat, and the fix is hardware diagnostics rather than more force-quitting.
FAQ
Does Alt+F4 close everything, including the browser?
No β Alt+F4 closes the active windows one at a time, not everything at once, while Control+Shift+W or Command+Shift+W closes a browser window with all its tabs. The shortcut you want depends on scope: one window, one tab, or the whole app. If the active window is a dialog, Alt+F4 closes the dialog instead of the program behind it.
Why does a pop-up come back every time I close it?
A page script or extension is re-opening it, and blocking the site's pop-ups in the browser's site settings is the reliable fix; closing the window only resets the trigger. Chrome and Edge both let you block pop-ups for one domain without affecting other sites. If the extension is the driver, disabling extensions one at a time identifies it in a few minutes.
Is it safe to force-quit from Task Manager or Force Quit?
Force-quitting ends the program without letting it save, so unsaved work in that app is lost, but it doesn't damage the operating system or hardware. The safe habit is to save first when the app still responds. Force-quitting a background system process by name is the riskier case; end user-facing apps, not services you don't recognize.
What do I do when Task Manager itself won't open?
Press Control+Alt+Delete and choose Task Manager from the security screen, which loads independently of the desktop, or sign out entirely. On macOS, try Command+Option+Esc again after a brief pause, and if that fails, force-quit the Finder. The security screen and the Force Quit dialog both sit closer to the operating system than the normal desktop.
How do I close a window with no title bar or close button?
The title bar is hidden, not gone β you're almost certainly in full-screen mode, so press F11 on Windows or Control+Command+F on a Mac. On a dialog box with no close button, press Alt+Space then C on Windows, or answer the dialog's prompt on a Mac. If the window belongs to a different user session, you can't close it from your account.
Can I close one tab without quitting the whole browser?
Yes, Control+W on Windows or Command+W on a Mac closes the current tab only, and the browser's built-in Task Manager can kill a single tab even when it's unresponsive. Quitting the whole browser loses every other tab's state and is slower. Middle-clicking a tab also closes just that tab.
Why does my computer freeze whenever I open a particular site or app?
The most likely causes are a failing storage device, overheating, or a corrupted install of the specific app, not the window itself. Repeat freezes at the same point justify hardware diagnostics rather than more force-quitting. The pattern β same app, same point, same freeze β is the clue that separates a broken window from a broken machine.