Print Page | Close Window

TrackPopupMenu parameters

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


Topic: TrackPopupMenu parameters
Posted By: binaryc
Subject: TrackPopupMenu parameters
Date 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.




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


Posted By: binaryc
Date Posted: 18 March 2005 at 10:42am
That's correct


Posted By: Oleg
Date Posted: 22 March 2005 at 5:53am
Try to dublicate OnCreateControl code to your view.

-------------
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