@Carlos Alves Diez, Angel
Hi,
Go to the Control Panel and run the applet called Power Options. Click the Advanced tab on the properties sheet, and look for the section that says: "When I close the lid of my portable computer". Click the down arrow for the list of options, and select "Do nothing".
In addition, here are some posts with the similar issue with yours, just for your reference, you can try the method mentioned in them:
https://superuser.com/questions/1292435/windows-on-second-monitor-moves-to-primary-monitor-after-sleep-lock
Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
Hope above information can help you.
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.