Fullscreen on secondary display

Started by
5 comments, last by joanusdmentia 17 years, 6 months ago
This is more a Win32 question, but it is API specific and it isn't D3D so I figured this would be the best place for it. I was recently given an LCD monitor for my b'day, so instead of throwing out my CRT (which while not great, is still decent enough) I've now got a dual-monitor setup and loving it. I've never had this before, so all of my OpenGL projects aren't multi-monitor aware so I thought I'd fire one up and see what happens. It opens up the window, I move it to the second monitor and switch to fullscreen mode.....my primary monitor changes resolution. Not entirely surprising, but how do I get it to change the resolution of my second monitor (ie. the monitor the window is on). I can find out which monitor it's on with MonitorFromWindow() and with GetMonitorInfo() and the MONITORINFOEX structure I can get the device name, but passing this to ChangeDisplaySettings() doesn't make any difference. Has anyone done this with OpenGL/Win32? I don't have any OpenGL games installed at the moment, but my D3D games run on the second monitor just fine.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
Advertisement
Did you use ChangeDisplaySettings() or ChangeDisplaySettingsEx(), as the latter seems to be the key as you can supply a device name and other info for the swap with it.
Ahh, I was using ChangeDisplaySettings() with DEVMODE::dmDeviceName filled out. ChangeDisplaySettingsEx() is indeed what I was after, thanks!
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
Hmm...now my desktop icons keep getting repositioned, despite me using the CDS_FULLSCREEN flag. The MSDN docs mention this can happen on Win95/98/ME and that doing the resolution change in a thread without any windows should fix it. I'm running WinXP SP2 so this shouldn't be a problem anyway, but I tried the separate thread without any luck.

Any ideas how to fix this?
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
Quote:Original post by joanusdmentia
Hmm...now my desktop icons keep getting repositioned, despite me using the CDS_FULLSCREEN flag. The MSDN docs mention this can happen on Win95/98/ME and that doing the resolution change in a thread without any windows should fix it. I'm running WinXP SP2 so this shouldn't be a problem anyway, but I tried the separate thread without any luck.

Any ideas how to fix this?


manually save the icon positions thru the desktop com interface..

you must be doing something wrong i guess, or this may be a bug in XP as well, i saw some fullscreen games reset my icon positions as well.

Projects: Top Down City: http://mathpudding.com/

Quote:Original post by Delfi
manually save the icon positions thru the desktop com interface..

you must be doing something wrong i guess, or this may be a bug in XP as well, i saw some fullscreen games reset my icon positions as well.


I was hoping there'd be a better way, but I've now got this mostly working by finding the ListView control that contains the desktop icons and getting & setting the icon positions on fullscreen mode changes. The only problem now is that when restoring the icons I have to put in an arbitrary delay to ensure the desktop has been updated with the new resolution, otherwise some icons end up in the wrong position (since the desktop size hasn't been updated). Is there a way to know when the desktop has been updated, or will I just have to make sure I wait long enough for it to usually work? Under high loads there's no guarenttee that whatever number I pick will be a long enough delay, without getting stupidly long that is.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
Hmm, I've manage to find another problem where if the desktop background is changed and then the program run, the background gets reset to the previous image. This all seems to be stemming from the use of ChangeDisplaySettingsEx(), using ChangeDisplaySettings() gets rid of both the icon and background image problems. Of course, then I can only use the primary display.

I'm starting a new thread for this, since it's really a different topic.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V

This topic is closed to new replies.

Advertisement