Re: Calculating the client area
- From: Ray Marshall <RayMarshall@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 21 Sep 2005 13:40:02 -0700
Yes, for some reason my mainframe window is getting created a little bit
bigger than the real client area. At first I thought it was big enough to
also hold the bottom menu/toolbar but its not quite that large. For example,
on a HiRes PPC device, the main frame window gets sized as 560 (or so)x480.
The real client area is 536x480. If I then put the SIP up and then down, it
will get properly resized.
Perhaps this is a MFC bug (I'm using VS 2005 b2). I traced through the code
and it appeared that MFC was creating the initial window with default values
(for the OS to size it properly) so I didn't think MFC would be the problem.
Perhaps I misread the code. I'll go back and look at that.
I don't recall exactly why but there've been numerous times where I'd like
to create a new window and want to resize it to fill the client area of the
device. It would be nice to somehow have a reliable way of calculating this.
That's basically what I'm looking for.
Thanks!
//Ray
"r_z_aret@xxxxxxxxxxxx" wrote:
> On Tue, 20 Sep 2005 12:24:11 -0700, Ray Marshall
> <RayMarshall@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >One of my biggest frustrations with WinCE programming is calculating the
> >client area for my app. This is the area in between the menu bar at the top
> >and the menu/toolbar at the bottom.
> >
> >I'm currently using GetClientRect for my main frame window. Unfortunately,
> >when my app first starts up, the size of the window is a bit larger than this
>
> Size of _which_ window? The client area or the full window, or ...?
>
> >area. Later, when the user switches to landscape or something, I get a
> >WM_SIZE event and now the window is properly sized. This causes all sorts of
> >frustrations.
>
> Are you saying that the initial size of the full window, and thus the
> client area, is bigger than after the first WM_SIZE message?
>
> I have code that sizes and positions my controls dynamically. Whenever
> I need to paint a window, I use GetClientRect to get the current
> dimensions of the client area and use that to determine the sizes and
> locations of all the controls. I've never noticed any problems.
>
> If you're having trouble determining the initial size of the _whole_
> window, that is a slightly different question. For Pocket PCs,
> straight C/C++, SHFullScreen is the most relevant function. For a more
> general approach, see my 19 June 2003 contribution to a thread called
> "Fullscreen" in comp.os.ms-windows.programmer.win32.
>
> >
> >Therefore, what's the best way to calculate this area? I'd like to use
> >GetSystemMetrics but there isn't a define for the complete size of the top
> >and bottom bars.
> >
> >Thanks,
> >//Ray
>
> -----------------------------------------
> To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
>
> Robert E. Zaret, eMVP
> PenFact, Inc.
> 500 Harrison Ave., Suite 3R
> Boston, MA 02118
> www.penfact.com
>
.
- Follow-Ups:
- Re: Calculating the client area
- From: r_z_aret
- Re: Calculating the client area
- References:
- Re: Calculating the client area
- From: r_z_aret
- Re: Calculating the client area
- Prev by Date: Re: 5-way control
- Next by Date: Re: 5-way control
- Previous by thread: Re: Calculating the client area
- Next by thread: Re: Calculating the client area
- Index(es):
Relevant Pages
|