Windows puts your laptop into a power-saving mode when you close the lid, which usually means your computer will power down when you close the laptop, even when an external display is connected. To prevent this, you need to tell the computer not to go into low-power mode.
1. On Windows 11, open Control Panel and go to Hardware and Sound > Power Options. Then, skip down to Step 3.
On Windows 10, right-click the Battery icon in the lower right-hand corner of your desktop.
( Note:If you cannot locate the battery icon, click the arrow that points up (Show Hidden Icons) to reveal more icons. If it's not visible on the desktop, the battery icon will be there.)
2. Click Power Options.
3. Click Choose what closing the lid does.
4. Notice the two categories next to When I close the lid: There's an option under On battery and Plugged in. Under each column, select the drop-down box to choose what happens when you close the lid.
5. Select Do nothing for one or both columns, depending on your needs.
Going forward when you close the lid the computer will continue to run, and will not disconnect from your monitor.
Warnings About Keeping Your Laptop on When Closed
Selecting Do nothing for the On battery section, as described above, can cause issues down the road. When you close the lid and toss the computer in a bag, it will continue to run, and it can get very hot. Increased heat can damage your computer. Pressing the power button and putting the computer to sleep when you are not using it is vital.
Also, depending on the monitor you're using, your laptop may be powering the monitor as well, which can drain your battery a lot more quickly. For this reason, you can choose different settings for when your laptop is on battery and when it's plugged in. Chances are if you're using an external monitor, you're probably near a power source, so it may be a good idea only to change the close lid behavior when your computer is plugged in.