![]() |
Site vs. Owner Confusion |
Post Reply ![]() |
Author | |
pavold ![]() Newbie ![]() Joined: 14 May 2007 Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() Posted: 28 October 2007 at 10:06am |
Hi,
CXTPCommandBars::TrackPopupMenu has two CWnd* arguments. First one is set to pPopupBar->m_pSite, while the second one goes to m_pOwner. What's the exact purpose (and distinction) of these arguments? Originally I thought, that m_pSite is the window that will receive notification/messages from the popup bar controls. I got this idea from the fact that the message sending is perfomed by CXTPControl::NotifySite(). However, recently I have discovered that this is not true and the pOwner is actually the one that will receive the message. Please explain. Thanks in advance, Pavol |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Yes, pOwner is window for WM_COMMAND message. if you don't set it - pSite will be used.
Better use non-static version: GetCommandBars()->TrackPopupMenuEx(...);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
pavold ![]() Newbie ![]() Joined: 14 May 2007 Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() |
I have observed a slightly different behavior.
What I'm trying to do is to show a popup menu, that will direct the messages to a concrete window. If I set only the pSite argument in the TrackPopupMenu, WM_COMMAND message will actually end up in the main CommandBars site (in my case it is CMainFrame). In other words if pOwner is not specified, global Site is used instead. Is this expected? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
yes, if you specify some CommandBars object.
also you can set TPM_RETURN flag to not send message but use return value from TrackPopupMenu.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |