Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Handling WM_ENTERMENULOOP and WM_EXITMENULOOP
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Handling WM_ENTERMENULOOP and WM_EXITMENULOOP

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


Joined: 07 February 2007
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote emmanuel Quote  Post ReplyReply Direct Link To This Post Topic: Handling WM_ENTERMENULOOP and WM_EXITMENULOOP
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
emmanuel View Drop Down
Newbie
Newbie


Joined: 07 February 2007
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote emmanuel Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
emmanuel View Drop Down
Newbie
Newbie


Joined: 07 February 2007
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote emmanuel Quote  Post ReplyReply Direct Link To This Post Posted: 08 February 2007 at 7:06pm

That did the trick. Thanks!

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.158 seconds.