How do I find the maximum window height that setscreenmode() will accept? [resolved]
by Tim Scheiman · in Torque Game Builder · 03/30/2010 (10:10 pm) · 1 replies
Hey all,
If you've got a windowed app... say... 1024 x 768 in size, open on a desktop sized 1440 x 900,
and you want to create a window that is the maximum HEIGHT allowed, but a specific width, how can you get this information out of windows? In this particular case, by experiment, I've found it to be 844 (asking for 845 just results in a minimized window in the taskbar and no more).
I know it depends on windows version (Vista can handle a window 712 high on a 1024 x 768 desktop, but XP and Win7 cannot), due to the changing sizes of the taskbar, the top of the window, the frame of the window, etc.
I've been using GetSystemMetrics and SystemParametersInfo functions in source to try to pry the correct data out, but the closest I've found is GetSystemMetrics(SM_CYFULLSCREEN), which on the 1440x900 desktop returns 850, which is still too big.
Can anyone point me to some windows voodoo (XP, Vista, and 7) that will give me the correct number for this in all cases (including things like 'large icon mode' in 7's taskbar)?
(I'm having a heck of a time switching from a 1024x768 fullscreen game to a window while in-game, when the user's desktop is 1024x768 or worse, 800x600)
Thanks!
-Tim
If you've got a windowed app... say... 1024 x 768 in size, open on a desktop sized 1440 x 900,
and you want to create a window that is the maximum HEIGHT allowed, but a specific width, how can you get this information out of windows? In this particular case, by experiment, I've found it to be 844 (asking for 845 just results in a minimized window in the taskbar and no more).
I know it depends on windows version (Vista can handle a window 712 high on a 1024 x 768 desktop, but XP and Win7 cannot), due to the changing sizes of the taskbar, the top of the window, the frame of the window, etc.
I've been using GetSystemMetrics and SystemParametersInfo functions in source to try to pry the correct data out, but the closest I've found is GetSystemMetrics(SM_CYFULLSCREEN), which on the 1440x900 desktop returns 850, which is still too big.
Can anyone point me to some windows voodoo (XP, Vista, and 7) that will give me the correct number for this in all cases (including things like 'large icon mode' in 7's taskbar)?
(I'm having a heck of a time switching from a 1024x768 fullscreen game to a window while in-game, when the user's desktop is 1024x768 or worse, 800x600)
Thanks!
-Tim
Torque 3D Owner Tim Scheiman
Ghost Ship Studios
It seems to work on XP, Vista, and 7, though I've yet to test Win7 with giant taskbar icons mode turned on (don't have it!)
Solution posted just in case anyone else is forum searching!
-Tim