I have given this further thought and have three more workarounds for you. However, I'm not sure not sure if two of them will work on Windows 7 systems other than Professional and Ultimate as they all use the projector settings and I don't think that the DisplaySwitch.exe is available in other versions. If it doesn't work, I'll post the
DisplaySwitch.exe and see if that's all we need to get it going.
METHOD 1: Projector Settings
Definately Will Only Work With Professional and Ultimate
After you press Win + L to lock your PC, Press Win + P and select the duplicate settings option
METHOD 2: Scheduled Triggers
This workaround involves changing the display to duplicate screens when you lock your computer and changing it back to 2 screens when you unlock it.
To do this, we'll use task scheduler to run some command lines on a trigger. The triggers will be either unlock or locking of the computer.
%windir%\System32\DisplaySwitch.exe /extend to use two screens
%windir%\System32\DisplaySwitch.exe /clone to clone the screens
or we could also use
%windir%\System32\DisplaySwitch.exe /internal to use just one screen
So lets set this up
Create the First Task
- Open the task scheduler by typing taskschd.msc into RUN or SEARCH and pressing ENTER
- Right Click on Task Scheduler (Local) and select 'Create Task'
- In the Create Task Window Type a Name for first the task (e.g. Single Display Lock)
- Type in a description (E.g. This task is triggered when Windows is locked and changes the display to a single display)
- Tick the 'Run with Highest Privilages' Box
- Change the 'Configure for' drop down box to "Windows 7, Windows Server 2008 R2"
- Select the TRIGGERS tab
- Click NEW
- In the Begin the Task Dropdown select "On workstation lock"
- in The Advanced Settings Select the "Delay Task for" box and type 3 Seconds in the box beside it. NOTE: you may need to increase this if it doesn't work for you.
- Click OK
- Select the ACTIONS tab
- Click NEW
- In the Program/Script box type the following %windir%\System32\DisplaySwitch.exe
- In the Add Arguments box type /clone
- Click OK
- Select the CONDITIONS tab
- Click OK to save and exit the new task
Create the Second Task
- Open the task scheduler by typing taskschd.msc into RUN or SEARCH and pressing ENTER
- Right Click on Task Scheduler (Local) and select 'Create Task'
- In the Create Task Window Type a Name for first the task (e.g. Extended Screen for Unlock)
- Type in a description (E.g. This task is triggered when Windows is unlocked and extends the screen to two monitors)
- Tick the 'Run with Highest Privilages' Box
- Change the 'Configure for' drop down box to "Windows 7, Windows Server 2008 R2"
- Select the TRIGGERS tab
- Click NEW
- In the Begin the Task Dropdown select "On workstation unlock"
- in The Advanced Settings Select the "Delay Task for" box and type 3 Seconds in the box beside it. NOTE: you may need to increase this if it doesn't work for you.
- Click OK
- Select the ACTIONS tab
- Click NEW
- In the Program/Script box type the following %windir%\System32\DisplaySwitch.exe
- In the Add Arguments box type /extend
- Click OK
- Select the CONDITIONS tab
- Click OK to save exit the new task
It takes a few seconds to come up but it should work a-ok.
Method 3: Batch Files
An alternate workaround would be to write two batch files one, for lock and one for dual screen display. In the batch files we sould need to include the command
rundll32.exe user32.dll, LockWorkStation to lock the workstation.
To create a Batch file, open notepad and paste the Grey text in, then save it as a *.bat extension
Batch 1
:: LOCK ME
%windir%\System32\DisplaySwitch.exe /clone
rundll32.exe user32.dll, LockWorkStation
Batch 2
:: DUAL SCREEN
%windir%\System32\DisplaySwitch.exe /extend
References:
Brink -
How to Create a Display Switch Shortcut in Windows 7
EDIT:
@Kirsch - Kari just let me know that you were after a duplicate screen when you locked the computer. I'm sorry that I missed this when I originally wrote it, I've fixed that and updated it above. If this is the first time that you've read this message then please disregard it (and thank Kari

). - Timo