How to Find Problems

I've outlined the problems with handling video modes and have given suggestions on how to eliminate problems during development. However, there are no guarantees. To make sure that your program works in all modes, you need to do some testing.

Clearly, you cannot test your entire program in all 48 video mode combinations. Rather, a better approach is to test with a few strategic video modes, such as:

  • 640 × 480, 256 Color The standard Windows driver, common mode for old hardware
  • 800 × 600, 256 Color The target video mode for Windows 98, common mode for old hardware
  • Your program's minimum recommended video mode, Small fonts The target video mode for your program
  • Your program's minimum recommended video mode, Large fonts The target video mode for your program
  • 1024 × 768, 16-bit Color, Small fonts Common mode for new hardware
  • 1024 × 768, 32-bit Color, Large fonts Common mode for new hardware

These six video modes should cover most of the bases. If your program has a simple interface (with no windows that need placement and sizing), if you developed using small fonts, and if you've made an effort to give all static text controls plenty of room to grow, you can probably get by with just doing the two minimum recommended video tests and 640 × 480 to make sure all the dialog boxes can be displayed in this mode. Note that the easiest way to make sure all dialog boxes fit in 640 × 480 is to view them as resources in Visual C++. You don't have to view them from the running program unless you change dialog box sizes during run time.

Lastly, you need to make sure that your program handles video mode changes while it is running. Typically, this means handling the WM_DISPLAYCHANGE message by recalculating object sizes, especially the average text size, and destroying any in-memory GDI resources that are resolution dependent, such as fonts and bitmaps, so that your program will re-create them using the correct metrics. Your program should be able to appear and function correctly after a display resolution change. Ideally, after a video mode change your program should look as if it was started in that video mode.

TIP
Handle the WM_DISPLAYCHANGE message.



Developing User Interfaces for Microsoft Windows
Developing User Interfaces for Microsoft Windows
ISBN: 0735605866
EAN: 2147483647
Year: 2005
Pages: 334

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net