Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Caption Bar in the Mainframe of an MDI
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Caption Bar in the Mainframe of an MDI

 Post Reply Post Reply
Author
Message
estebann10 View Drop Down
Newbie
Newbie


Joined: 03 June 2006
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote estebann10 Quote  Post ReplyReply Direct Link To This Post Topic: Caption Bar in the Mainframe of an MDI
    Posted: 03 June 2006 at 7:28am

Hi !!

I'm trying to create a Caption Bar in the Mainframe of my MDI application. Samples show how to procede with a SDI, but not with a MDI. I'm trying to split the Mainframe but i'm getting mad... Could you please give me some help on this little problem ?

Thanks for advance...

Back to Top
estebann10 View Drop Down
Newbie
Newbie


Joined: 03 June 2006
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote estebann10 Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2006 at 12:43pm

Any Idea ??

Back to Top
g_j_a_i_n View Drop Down
Groupie
Groupie
Avatar

Joined: 27 August 2005
Status: Offline
Points: 94
Post Options Post Options   Thanks (0) Thanks(0)   Quote g_j_a_i_n Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2006 at 12:50am


Any ideas? Even I need help...
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 August 2006 at 8:04am
Hi,
1. Add detrived class from CXTCaption
2. Catch
ON_MESSAGE(WM_SIZEPARENT, OnSizeParent)
 
and
LRESULT CMyCaption::OnSizeParent(WPARAM, LPARAM lParam)
{
 AFX_SIZEPARENTPARAMS* lpLayout = (AFX_SIZEPARENTPARAMS*)lParam;
 if (GetStyle() & WS_VISIBLE)
 {
  // align the control bar
  CRect rect;
  rect.CopyRect(&lpLayout->rect);
  CSize sizeAvail = rect.Size();  // maximum size available
 
  CSize size(sizeAvail.cx, 20);
 
  size.cy = min(size.cy, sizeAvail.cy);
  lpLayout->sizeTotal.cy += size.cy;
  lpLayout->sizeTotal.cx = max(lpLayout->sizeTotal.cx, size.cx);
  lpLayout->rect.top += size.cy;
  rect.right = rect.left + size.cx;
  rect.bottom = rect.top + size.cy;
  // only resize the window if doing layout and not just rect query
  if (lpLayout->hDWP != NULL)
   AfxRepositionWindow(lpLayout, m_hWnd, &rect);
  Redraw();
 }
 return 0;
}
3. create caption as child of mainframe.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.