Print Page | Close Window

Caption Bar in the Mainframe of an MDI

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4330
Printed Date: 11 November 2025 at 12:36am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Caption Bar in the Mainframe of an MDI
Posted By: estebann10
Subject: Caption Bar in the Mainframe of an MDI
Date 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...




Replies:
Posted By: estebann10
Date Posted: 07 June 2006 at 12:43pm

Any Idea ??



Posted By: g_j_a_i_n
Date Posted: 11 August 2006 at 12:50am


Any ideas? Even I need help...


Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net