![]() |
Pop-Up Menu is not disappearing |
Post Reply ![]() |
Author | |
Cowboy ![]() Newbie ![]() ![]() Joined: 14 September 2006 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() Posted: 14 September 2006 at 4:07pm |
I am implementing a pop-up menu upon right clicking in my app's client window and am using Code Jock's CXTPCommandBars::TrackPopupMenu(...) function call. The menu pops up correctly, but when I switch to a different window, the menu stays up even though the app's window is not the foreground window anymore.
Here is a snippet of the code: ::SetMenuDefaultItem(pSubMenu->m_hMenu, ID_EGA_CLOSE, FALSE); CPoint pos; GetCursorPos(&pos); ::SetForegroundWindow(this->m_hWnd); CXTPCommandBars::TrackPopupMenu(pSubMenu, TPM_NONOTIFY, pos.x, pos.y, this); Also, when I switch to the MFC TrackPopupMenu(...) call, the pop-up menu works perfectly. What is going on and how can I get the Code Jock menu to work correctly? FYI, the app window is MFC and not Code Jock. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
What version of Toolkit ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Cowboy ![]() Newbie ![]() ![]() Joined: 14 September 2006 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
Oleg hi!
I am working with Xtreme ToolkitPro 2006 Q2 version 10.2 |
|
![]() |
|
Cowboy ![]() Newbie ![]() ![]() Joined: 14 September 2006 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
Oleg,
Update: I've been trying to debug the issue and have discovered that in the working Tray App Demo sample provided in the Code Jock Kit, a WndProc(...) function for the CXTPKeyboardManager class receives a WM_ACTIVATEAPP message. However, in my app, I never receive this windows message even though I am hooked with the keyboard. What is the missing link??? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
You also show menu from tray?
Try as in sample create derived class:
class CXTTrayIconEx : public CXTTrayIcon { bool CreateMinimizeWnd(CWnd* /*pWndApp*/) { return true; } }; |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Cowboy ![]() Newbie ![]() ![]() Joined: 14 September 2006 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
My project is not a tray icon with a dialog like the sample, but rather just a simple, small window that lives in the taskbar. My code is based upon a project found in Code Projects. The main difference is that my version has a right-click menu, which I am trying to add Code Jock capability to.
As I indicated before, my class does not inherit from Code Jock but rather from the MFC class "CProgressCtrl". The only place where I implement the Code Jock code is when calling the following line: CXTPCommandBars::TrackPopupMenu(pSubMenu, TPM_NONOTIFY, pos.x, pos.y, this); However, when I switch to the MFC call: ::TrackPopupMenu(pSubMenu->m_hMenu, 0, pos.x, pos.y, 0, this->m_hWnd, NULL); My program works (By this I mean the right-click menu disappears when you click outside of the window)! What do I need to do to get the Code Jock "TrackPopupMenu" method to work? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
this can be problem. OS sends WM_ACTIVATEAPP if your applciation has window that become deactive.... Do you have some not child window like dialog in CodeProject sample? If yes, you need activate it first. If not, I guess you can try create hiddne window and activate it.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Cowboy ![]() Newbie ![]() ![]() Joined: 14 September 2006 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
My project unlike the sample from Code Projects does not have another window nor dialog. The window in the taskbar is created from my winmain and its parent is the taskbar itself.
Sorry, I am not clear on the last half of you post oleg. What would be the benefit of creating a hidden child window? Are you suggesting that user should right-click on this hidden window to bring up the menu rather than on the taskbar window? |
|
![]() |
|
Cowboy ![]() Newbie ![]() ![]() Joined: 14 September 2006 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
Bump...
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I need some project to debug/to test. Can you just create new project/copy some parts from your aplication to show problem and attach in issue or here.
|
|
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 |