Print Page | Close Window

Handling Close button of XTPFramwWnd

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=5448
Printed Date: 11 November 2025 at 4:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Handling Close button of XTPFramwWnd
Posted By: babumohan
Subject: Handling Close button of XTPFramwWnd
Date Posted: 07 November 2006 at 6:04am
How can I handle Close Button of XTPFrameWnd TitleBar

-------------
Babs



Replies:
Posted By: babumohan
Date Posted: 07 November 2006 at 6:26am
it is not for XTPFrameWnd.  it is for CUEXTPDockWindow

-------------
Babs


Posted By: Oleg
Date Posted: 07 November 2006 at 9:05am
Hi,
 
See in MSDN WM_SYSCOMMAND and SC_CLOSE


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: babumohan
Date Posted: 08 November 2006 at 4:55am

Hi

 Good day. I would like to use CXTWndHook.
 I tried with the above mentioned WM_SYSCOMMAND and SC_CLOSE. It is not working properly


-------------
Babs


Posted By: Oleg
Date Posted: 08 November 2006 at 5:39am
Hello,
 
Show code you tried. 
WM_SYSCOMMAND +SC_CLOSE send if user press "X" buttton, but may be not if user Close using Alt+F4. 
So also try catch standard WM_CLOSE message


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: babumohan
Date Posted: 08 November 2006 at 5:52am
I used CXTWndHook::WindowProc(message, wParam, lParam) to get all messages.
void CMyMainFrame::OnSysCommand(UINT nID, LPARAM lp)
{
  if (nID==SC_CLOSE) {
//    ... // handle it
    return ;
  }
  // pass to base class: important!
  return CXTPFrameWnd::OnSysCommand(nID, lp);
}


-------------
Babs


Posted By: babumohan
Date Posted: 08 November 2006 at 7:19am
I used following ways to implemeent the above said interface
1 .CXTWndHook::WindowProc(message, wParam, lParam) to get all messages.
2. void CMyMainFrame::OnSysCommand(UINT nID, LPARAM lp)
{
  if (nID==SC_CLOSE) {
//    ... // handle it
    return ;
  }
  // pass to base class: important!
  return CXTPFrameWnd::OnSysCommand(nID, lp);
}


-------------
Babs



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