|
-
March 22nd, 2006, 07:15 PM
#1
2 CDialogs and sharing 1 systray icon - how to implement?
Hello Everyone,
I have previously been able to get one dialog and 1 systray icon to be working, I could right-click on the icon and get the msg trapped. This is all good until I have to add another CDialog to the project. I do DoModal() on both dialogs with threads so that one could be visible while the other is not.
I have tried to add the systray icon in the CWinApp and Dialog1. However, the most troubling part is to have the right-click msg be trapped and routed.
Please help me with clarifying the following:
1. m_IconData.hWnd = m_hwnParent->GetSafeHwnd()
* m_hwnParent is the "this" pointer passed in from dialog1
Does m_IconData.hWnd have to be associated with a window that is active all the time? Since one of my 2 dialogs will be hidden while the other is shown.
Is there from GetAfxApp() that I can pass for this value?
2. In OnTrayNotification(WPARAM wParam, LPARAM lParam) I have
m_hwnParent->SendMessage(WM_SYSTRAYICON_CLICKED,0 ,(LPARAM) &pos );
I have naively thought that if I changed the value of hwnParent while I do the ShowWindow(SW_SHOW/SW_HIDE) handling, I could have the right-click msg being trapped and send to the window that is active at the time the click takes place.
Is this a correct assumption?
My ultimate question is it possible to have 2 dialogs, one is always hidden while the other is shown during the lift time of the app, to process the right-click from the SysTray icon?
Desparated.
Jiac
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|