How do i go about ensuring that my application window will show well in all resolutions (from Crt - High Res LCD)...
Or do i rather ensure that when i create Window my size in no larger than 800x600... ?
Printable View
How do i go about ensuring that my application window will show well in all resolutions (from Crt - High Res LCD)...
Or do i rather ensure that when i create Window my size in no larger than 800x600... ?
I'm not sure, but I believe you want to catch the VM_NCCREATE and/or VM_CREATE and set the size of the window within the CREATESRUCT.
--
Mats
It's a complex issue from the design point of view. Usually you design for on one resolution (preferably the minimum one) and make an effort to ensure a fluid design (some like to call it Liquid).
So, assuming you set 800x600 as the minimum requirements, you lay out your controls for this window size. Then what?
Well, this is where it gets complicated. You have to establish what controls are allowed to move and what controls are allowed to resize when the window changes sizes, coding this into the resize events you are catching (I can't help with Windows API or MFC. Only WxWidgets).
Observe some applications and look at how some controls remain still and unchanged, while others move and/or change size in the window when you resize it. That's what you would ideally want to achieve. Some tools offer easy shortcuts for this. WxWidgets (a GUI api), for instance offers Sizers which makes the design of fluid layouts a kid's play (after you get used to the philosophy behind, that is). MFC and Win32 API will force you to code the whole thing EDIT: unless you have access to RAD tools with click & drag control placement which usually offer their own methods. But as long as you know how you want a window to increase its size, it's just not that difficult, I'm sure.
Came across functions such as "GetSystemMetrics" and "GetTextMetrics" which retrieves the window size per resolution and text size per resolution... My concerns as you mention are controls within the windows, such as edit controls and buttons... I guess the best option is to design for 800x600, but then how would the application look in a screen resolution of 1280X1024? Is it going to stretch or something?
Of course. You have to stretch your controls to a larger width/height, but I would usually design for 1024x768 or 1280x1024 resolution, as they are pretty common today.
Changing resolutions will not deface your controls in any way (with one exception). Any operating system offering a GUI worth its salt will automatically scale you controls accordingly. The end result will still be a window with crisp looking controls. So if you layout for, say 800x600, and then change the resolution for 1024x768, your window will look smaller on the screen and all controls will be scaled accordingly.
Basically what this means is that as far as resolutions are concerned, the operating system will do that for you scaling things on screen accordingly (like just it does with your applications). But because changing resolutions affect the free space outside the window, usually we want to allow users to resize their windows. On that case you need to catch window resize events (do not use window paint events or load events. A resize event is also handled during window first load) and move and resize your controls as you wish.
...
The only exception to the resolution changing not affecting the detail and crispness of your screen is if you are using a wide screen monitor and want to look at default resolution ratios (or the other way around). Typical resolutions have a ratio of 1.3 (jut divide 800 by 600 for instance). Widescreen monitors offer resolutions with ratios of 1.6 and higher I reckon. When displaying resolutions with different ratios your screen may look blurred. You should not worry, because a) it's dependent on monitor quality and b) it's only the result of someone using the wrong suggested resolution for their screen type which basically means is not your problem.
EDIT: In other words and to make this short, your only concern should be the current window size, not the resolution of the screen.
1 - Set a minimum requirements resolution ( 800x600 is a common choice depending on the application)
2 - Design you windows content with this resolution in mind.
3 - Catch window resize events, read the current values from within and move and resize you controls accordingly.
Standard resolution is 4/3 (1024x768, 1280x1024 for example). Widescreen is 16/9 (1280x720 for example), or 16/10 (1920x1200 for example).
16/10 is more common for today's computer screens, but TVs are still 16/9. 4/3 monitors exist for lower-end computer screens and laptops and 4/3 TVs are being phased out, pretty much. Or will be.
If you are doing manual blitting, just resample the image to the higher resolution. You wont be able to tell its runnign in higher reslolution, but at least it will look normal.
Tried running a simple application (window with a gray shaded rectangle with one object drawn unto it) on an NT4 Machine which has a max screen resolution of 800x600 and Max of 16 colors. Well this application window is small enough to fit any resolution but problem i picked up was the gray shade on rectangle was more lighter and showing lines on background instead of full shade. Also, the application was flickering which was not happening on my XP PC... Thought XP was NT as well
Win 2000 was an NT core, XP is not.
If the NT PC was running 800x600 in 16 colours (I think you mean 16 bit) it probably has a VERY slow graphics card. It may mot be possible to not flicker, depending on your app.
If the NT machine is your target then develop/test on that machine and adjust accordingly.
If the NT is not a required target machine, ignore it, some machines are too slow/old to modify your apps to run on.