Failed to create the D3D9 device, This can happen if the desktop is locked

The more advanced games are pretty sensitive to the resolution of the screen, moreover if we are playing them through an external game launcher like Steam. I have seen conflicts with the screen resolution blacking out the screen totally or at least pausing the game. Similarly, a known issue with conflicting screen resolution is when players get the error:

Failed to create the D3D9 device, This can happen if the desktop is locked

Failed to create the d3d9 device. This can happen if the desktop is locked

One possible reason for the error could be that the resolution of the game is different from the current monitor display configuration, though there could be other reasons for behind the issue.

You could try the following solutions step by step in an attempt to resolve the error:

1] Change the resolution of the game when launched through Steam

When launching the game through Steam, we could launch the game in Windowed mode. This would help in matching the monitor’s resolution with the resolution of the game. The procedure to do the same is as follows:

  1. Right-click on any empty space on the desktop and select Display settings from the list.
  2. Check and note the current resolution of the monitor. We have to match this with the resolution of the game.
  3. Now launch the Steam client of your game and go to Library and then Properties.
  4. In the General tab, click on Set Launch Options. Enter the entry as “-w 1920 –h 1200” (without the codes).
  5. Press OK and exit the screen.

Check if this resolution works. We could also try changing the resolution of the monitor screen if unwilling to do the same with the game.

Another workaround is to enter the command  “-windowed” instead of the resolution in Set Launch Options. Upon doing so, the game would launch in a smaller window and after that we could adjust size and corners as per our wishes.

2] Change the resolution in game files manually

In case the above method does not work, we could change the resolution of the games by opening the Steam config files on a Notepad window on the system and changing the same manually. The process is as follows:

1] Navigate to the directory of your game’s Steam launcher. A sample could be Steam/Steamapps/Common/Counter-Strike/CSGame/Config.

2] Search for the file “Machineoptions.ini.” Right-click on it and then select Open with. From the options, open it with Notepad.

3] The resolution would be mentioned such that the value of X represents the width and Y the height. Change them accordingly to match the resolution of the monitor screen.

4] Another way to make sure the configuration always matches the resolution of the monitor screen is to remove ; from behind the values of X and Y. Eg:

;ResX=1920

;ResY=1200

After removing ; from both the values, we get,

ResX=1920

ResY=1200

For more information, please check this Reddit discussion thread here.

Download this VPN to secure all your Windows devices and browse anonymously
Posted by on , in Category Windows with Tags
Karan Khanna is a passionate Windows 10 user who loves troubleshooting Windows problems in specific and writing about Microsoft technologies in general.