Posted on 1999-07-17
I am building an interface by windows programming in C. I want my interface can be displayed beautifully in any pc's resolution (640x480, 800x600, 1024x768 etc). So, I used GetSystemMetrics to get the winWidth n winHeight. But, the problem is when I change all the components' location and structure of the interface into fraction like
hButton = createWindow("BUTTON",...,...,...,...,....,... 3*winWidth/16, 4*winHeight/25, 18*winWidth/80,....,....);
the interface can't be displayed well in other pc. The structure of the interface destroy if the interface been displayed in other resolution. My pc's resolution is 800x600.
How am I want to display the interface well in any pc's resolution?
I create some graphics components (buttons, radion buttons, track bars etc) in resource file. The position of the components in the interface is set by numbers. But now I want to change it to
n*winWidth/m, x*winHeight/y which, n, m, x, y is any numbers so that the graphics components also can be displayed well in other pc's resolution also.
What should I do?