Frame window rect not including toolbars
Marty Wagner -- marty@concentra.com Wednesday, October 09, 1996 Environment: VC++ 4.1, NT 3.51 I need to get the window rectangle for my mainframe window, but I don't want to include the toolbars or status bars (that is, I only want the area in which I can position non-docking windows). If I use GetClientRect, it returns the entire window rectangle. CWnd::RepositionBars seemed like a likely candidate, at least from the documention, but it didn't do what I thought it would. I'm calling it like this: RepositionBars(0, 0xffff, AFX_IDW_PANE_LAST, CWnd::reposQuery, &rect, NULL, FALSE); The rect parameter seems to be getting the rectangle of the first toolbar. Any suggestions? Is there a better way to do this? Marty Wagner marty@concentra.com
Dave_Rabbers@Quinton-Eng.CCMAIL.CompuServe.COM Friday, October 11, 1996 [Mini-digest: 4 responses] I use the following, CRect rectFrameWnd; RepositionBars( 0, (UINT) -1, AFX_IDW_PANE_FIRST, reposQuery, &rectFrameWnd ); I then position my window at CPoint( 0, 0 ) in the frame windows client area with a size matching that of rectFrameWnd. ______________________________ Reply Separator _________________________________ Subject: Frame window rect not including toolbars Author: INTERNET:marty@concentra.com at CSERVE Date: 10/10/96 1:38 PM Sender: owner-mfc-l@majordomo.netcom.com Received: from majordomo.netcom.com (listless.netcom.com [206.217.29.105]) by arl-img-6.compuserve.com (8.6.10/5.950515) id NAA09543; Thu, 10 Oct 1996 13:32:39 -0400 Received: by majordomo.netcom.com (8.7.5/8.7.3/(NETCOM MLS v1.01)) id JAA18759; Thu, 10 Oct 1996 09:46:26 -0700 (PDT) Message-Id: <325BF5A3.1649@concentra.com> Date: Wed, 09 Oct 1996 14:57:39 -0400 From: martyOrganization: concentra X-Mailer: Mozilla 3.0Gold (WinNT; I) Mime-Version: 1.0 To: mfc-l@netcom.com Cc: marty@concentra.com Subject: Frame window rect not including toolbars Content-Type: text/plain; charset=us-ascii
John Bundgaard -- johnb@image.dk Thursday, October 17, 1996 Your CMainFrame object has a handle to the client window called m_hWndMDIClient. So getting the rectangle is just a matter of=20 doing the following: (some where in a CMainFrame function) CRect rcClientWnd ::GetClientRect(m_hWndMDIClient, &rcClientWnd); John Bundgaard =D8rum & Jensen Elektronik A/S johnb@image.dk ---------- > From: marty> To: mfc-l@netcom.com > Cc: marty@concentra.com > Subject: Frame window rect not including toolbars > Date: 9. oktober 1996 19:57 >=20 > Environment: VC++ 4.1, NT 3.51 >=20 > I need to get the window rectangle for my mainframe window, but > I don't want to include the toolbars or status bars (that is, > I only want the area in which I can position non-docking windows). =20 > If I use GetClientRect, it returns the entire window rectangle. >=20 > CWnd::RepositionBars seemed like a likely candidate, at least > from the documention, but it didn't do what I thought it would. > I'm calling it like this: >=20 > RepositionBars(0, 0xffff, AFX_IDW_PANE_LAST, CWnd::reposQuery, > &rect, NULL, FALSE); >=20 > The rect parameter seems to be getting the rectangle of the first > toolbar. =20 >=20 > Any suggestions? Is there a better way to do this? >=20 > Marty Wagner > marty@concentra.com
| Вернуться в корень Архива |