Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - TrackPopupMenu parameters
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TrackPopupMenu parameters

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


Joined: 15 March 2005
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote binaryc Quote  Post ReplyReply Direct Link To This Post Topic: TrackPopupMenu parameters
    Posted: 17 March 2005 at 3:29pm

I'm not really sure what I should pass as the parameters for CXTPComamndBars::TrackPopupMenu.

The problem:
I have a (split) view inside a frame. My context menu has some non-button controls on it (a button popup).

The following combinations cause the menu to work fine, except the non-button controls appear as buttons.

- view as pWnd, null as pWndOwner, null as pCommandBars
- frame as pWnd, view as pWndOwner, null as pCommandBars
- frame as pWnd, view as pWndOwner, frame->GetCommmandBar() as pCommandBars
- null as pWnd, view as pWndOwner, frame->GetCommmandBar() as pCommandBars

All of the following combinations cause the split button to appear correctly, but the view doesn't get WM_COMMAND messages:

- frame as pWnd, null as pWndOwner, null as pCommandBars
- view as pWnd, frame as pWndOwner, null as pCommandBars
- view as pWnd, null as pWndOwner, frame->GetCommmandBar() as pCommandBars
- null as pWnd, null as pWndOwner, frame->GetCommmandBar() as pCommandBars

From what I can tell, pWnd is the window that gets the messages, unless pWndOwner is non-null, in which case that's the window that gets the messages, unless pCommandBars is non-null, and pWndOwner is null, in which case the owner of the command bars gets the message

If this is the case, then it seems pCommandBars and pWndOwner are mutually-exclusive.  If that is true, then there should really be two overloaded functions rather than one function that takes both paramaters.  It also seems that if either pWndOwner or pCommandBars are set then pWnd gets ignored.

Is what I'm trying to do possible?  If so, what's the proper set of arguments to pass?

The documentation is unhelpful in this situation and none of the samples appear to try to do something like this.

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: 18 March 2005 at 12:21am
"except the non-button controls appear as buttons."   so you convert them in OnCreateControl handler?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
binaryc View Drop Down
Newbie
Newbie


Joined: 15 March 2005
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote binaryc Quote  Post ReplyReply Direct Link To This Post Posted: 18 March 2005 at 10:42am
That's correct
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: 22 March 2005 at 5:53am
Try to dublicate OnCreateControl code to your view.
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.031 seconds.