Have you ever clicked the X button to close a pop-up window but it opens something else instead? That’s because the close (X) button is easy to fake. I don’t recommend clicking on any button in a pop-up window. Luckily, there’s a simple keyboard trick you can use to close a program or window that doesn’t require you click on anything.
The simple two-key combination
The two-key combination [Alt] + [F4] will close the currently active program on your screen. It performs the equivalent of pressing the “close” (X) button in the corner of the window. Open another program or window and try it now.
Careful – if you don’t open another window before trying this, it will close this webpage since it’s probably the active window.
The “active” window is the program that’s currently being used. If you try it and the wrong program closes, that’s because the window you wanted to close was not active. So you’ll have to make it active. But what if you want to do that without clicking on anything, just in case?
Select another window without the mouse
To make a different window active without clicking on it, hold [Alt] while you press [Tab] as many times as it takes until the program you want is selected. Now you can close that program as instructed above.
If you have no programs open (which means your desktop is currently the active application), it will try shutting down Windows (meaning it will try to turn your computer off). So if you get the computer shutdown message when you try this, that’s why. If that happens, cancel the shutdown and use [Alt] + [Tab] again to select the program you want.
In rare occasions, the window may be stubborn and won’t close at all. This could mean your computer or browser is already infected with malware and it’s preventing the window from closing. If that’s the case, try closing your browser first. If it still doesn’t go away, you should perform some virus/malware scans and disinfect your machine.
This method, like any, is not foolproof, but it’s definitely another trick worth having in your arsenal.