Bugs item #2990983, was opened at 2010-04-22 12:42
Message generated for change (Tracker Item Submitted) made by emlynmu
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2990983&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: win32
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Emlyn Murphy (emlynmu)
Assigned to: Nobody/Anonymous (nobody)
Summary: EnumDisplaySettings returns a non-modifiable structure
Initial Comment:
It appears that the python object returned from EnumDisplaySettings is not modifying the C struct. I am attempting to change the display resolution using ChangeDisplaySettingsEx, which I believe used to work. Here is some sample code demonstrating how I'm attempting to change the resolution of the 2nd monitor to 800x600 (which is a valid mode).
#####
winDev = win32api.EnumDisplayDevices(DevNum=1)
winSettings = win32api.EnumDisplaySettings(winDev.DeviceName, win32con.ENUM_CURRENT_SETTINGS)
print 'Current Resolution: %ix%i' % (winSettings.PelsWidth, winSettings.PelsHeight)
winSettings.PelsWidth = 800
winSettings.PelsHeight = 600
print 'Target Resolution: %ix%i' % (winSettings.PelsWidth, winSettings.PelsHeight)
win32api.ChangeDisplaySettingsEx(winDev.DeviceName, winSettings)
winSettings = win32api.EnumDisplaySettings(winDev.DeviceName, win32con.ENUM_CURRENT_SETTINGS)
print 'New Resolution: %ix%i' % (winSettings.PelsWidth, winSettings.PelsHeight)
#####
The monitor flickers, but the resolution does not actually change. I have two monitors which are set to different resolutions. If I call EnumDisplaySettings on the first monitor and then I use the returned object to change the settings of the second monitor, it does indeed change the 2nd monitor to match the settings of the first. This is leading me to believe that the following lines are not actually modify the C struct:
winSettings.PelsWidth = 800
winSettings.PelsHeight = 600
On the python side of things, PelsWidth and PelsHeight are being modified, but it doesn't seem to be carrying over to the C side.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2990983&group_id=78018
|