Sizing window with scrollers. Dont work ! Help !

Sizing window with scrollers. Dont work ! Help !

Post by Rafael Sant » Sun, 17 Apr 1994 05:11:53

Hello all,

another puzzling problem with windows (or, hopefully, with me ;-)
I want to display a 512x512 bitmap in a subwindow with scrollers
(both horizontal and vertical), but I want to make the window
originally exactly the size of the bitmap (no white areas around, no
scrollers initially). So I calculate:
addx = 2*GetSystemMetrics(SM_CXFRAME);
addy = 2*GetSystemMetrics(SM_CYFRAME)+GetSystemMetrics(SM_CYCAPTION);
and when I call SetupWindow, I call
Well, it does not work. Making calls to GetWindowRect() before and after
the call, and playing with the size of the window, I discovered that
the sizes should be x:512+8, y:512+8+20, and they can display the image
as I want when the values returned by GetWindowRect correspond to the above.
The problem is, when I set them with MoveWindow, an horrible white bar
appears on the bottom of the window, and I suspect that it is corresponding to
the height of the scrollbar.
Questions: Why does it appears only on the horizontal ?
What can i do to avoid it and make it appear as just size, with the scroll
bars ONLY if I have the need to reduce the size of the window ?


Thanks very  much in advance,

There's an extremely small  but nonzero chance that, through a process known as
'tunneling', this message may spontaneously disappear from its present location
and reappear at any random place in the Universe, including newsgroups and your
private mail. I am not responsible for any inconvenience that may result.