Has anyone experienced the function Windows SystemParametersInfo reporting a different display resolution after returning from sleep mode? My display is 3840X2160, which the SystemParametersInfo reports accurately. However, upon returning from sleep mode, SystemParametersInfo gives a resolution of 2560x1392, which doesn't match any configuration in the Windows Registry under Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers. The actual screen resolution has not changed - the desktop is 3840X2160, but the function reports 2560x1392.

Waiting a while thinking everything hasn't woken up yet doesn't seem to help. Problematic when your program needs to find the right edge of the screen.

Recommended Answers

All 2 Replies

I recall this being an issue in many versions of Windows. From memory it's a driver issue so you'll have to decide if you must handle deficient drivers in your code. I mean, your code most likely already had queried the display resolution so why was this done again?

commented: Good point. I'll have to move that piece of code somewhere else. Can't imagine someone would change resolutions often. +6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.