Hi,
I have a tray icon which calls up a popup menu when the mouse is over it using:
ON_REGISTERED_MESSAGE(TaskbarCallbackMsg, OnTaskbarNotify)
NOTIFYICONDATA * pNotify = new NOTIFYICONDATA;
pNotify->hWnd = this->m_hWnd;
pNotify->uFlags = NIF_MESSAGE|NIF_ICON;
pNotify->hIcon = officon;
pNotify->uCallbackMessage = TaskbarCallbackMsg;
Shell_NotifyIcon(NIM_ADD, pNotify);
LRESULT CMainFrame::OnTaskbarNotify(WPARAM wParam, LPARAM lParam)
{ ShowPopup(); // create popup menu
return 0;}
That's fine in debug mode, but when I compile as release the tray icon no longer appears. Any idea why ?
Secondly, can I get the popup menu to appear only when the right-mouse-button is clicked, currently it also appears when the mouse is over the icon...I have enabled OnRbuttondown, but the function OnTaskbarNotify seems to get in first and the menu pops up before the mouse click.
Thanks in advance.
I have a tray icon which calls up a popup menu when the mouse is over it using:
ON_REGISTERED_MESSAGE(TaskbarCallbackMsg, OnTaskbarNotify)
NOTIFYICONDATA * pNotify = new NOTIFYICONDATA;
pNotify->hWnd = this->m_hWnd;
pNotify->uFlags = NIF_MESSAGE|NIF_ICON;
pNotify->hIcon = officon;
pNotify->uCallbackMessage = TaskbarCallbackMsg;
Shell_NotifyIcon(NIM_ADD, pNotify);
LRESULT CMainFrame::OnTaskbarNotify(WPARAM wParam, LPARAM lParam)
{ ShowPopup(); // create popup menu
return 0;}
That's fine in debug mode, but when I compile as release the tray icon no longer appears. Any idea why ?
Secondly, can I get the popup menu to appear only when the right-mouse-button is clicked, currently it also appears when the mouse is over the icon...I have enabled OnRbuttondown, but the function OnTaskbarNotify seems to get in first and the menu pops up before the mouse click.
Thanks in advance.