Print Page | Close Window

Handling WM_ENTERMENULOOP and WM_EXITMENULOOP

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=6344
Printed Date: 19 May 2024 at 10:07am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Handling WM_ENTERMENULOOP and WM_EXITMENULOOP
Posted By: emmanuel
Subject: Handling WM_ENTERMENULOOP and WM_EXITMENULOOP
Date Posted: 07 February 2007 at 3:00pm
In a normal MFC app (not using ToolkitPro) you can receive the WM_ENTERMENULOOP and WM_EXITMENULOOP messages through the CFrameWnd derived class. However, this does not appear to be the case with a ToolkitPro MFC app. Is there a way to receive these messages (ideally through the derived CFrameWnd class)?
 
Thanks



Replies:
Posted By: Oleg
Date Posted: 07 February 2007 at 3:15pm
Hi,
 
No, CommandBars don't have such messages. What do you want implement in such handlers?


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


Posted By: emmanuel
Date Posted: 07 February 2007 at 4:53pm

Ahh, so these messages are never generated. I'm developing an application that contains a 3D render window (using Direct3D) that is continously rendered to. However, I would like to pause the rendering when the user activates a menu (e.g. File). The standard way of handling this in a D3D app is to pause/unpause the drawing in response to the WM_ENTERMENULOOP and WM_EXITMENULOOP messages. Is there some analogous way of handling this with CommandBars?

Thanks again.



Posted By: Oleg
Date Posted: 08 February 2007 at 1:20am
Hi,
 
If you have 10.3/10.4 here workaround:
 
class CMyCommandBars : public CXTPCommandBars
{
 DECLARE_DYNCREATE(CMyCommandBars)
 CMyCommandBars()
 {
  m_bTracking = FALSE;
 }
 void OnTrackingModeChanged(CXTPCommandBar* pCommandBar, int bMode)
 {
  CXTPCommandBars::OnTrackingModeChanged(pCommandBar, bMode);
  if (bMode && !m_bTracking)
  {
   m_bTracking = TRUE;
   GetSite()->SendMessage(WM_ENTERMENULOOP);
  }
  else if (!bMode && !GetMouseManager()->IsTrackedLock(0) && m_bTracking)
  {
   m_bTracking = FALSE;
   GetSite()->SendMessage(WM_EXITMENULOOP);
  }
 }
 BOOL m_bTracking;
};
IMPLEMENT_DYNCREATE(CMyCommandBars, CXTPCommandBars)
 
 
usage:
 
 if (!InitCommandBars(RUNTIME_CLASS(CMyCommandBars)))
  return -1;


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


Posted By: emmanuel
Date Posted: 08 February 2007 at 7:06pm

That did the trick. Thanks!




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