ForeverCode
Programmer
I'm having issues getting the callback to work for my systray icon. I'm using PreTranslateMessage(MSG* pMsg) to get all the messages in the main dialog. This is what I'm using to make the icon go:
NOTIFYICONDATA XAIMIcon;
HINSTANCE hInst;
hInst = (HINSTANCE)GetWindowLong(m_hWnd,GWL_HINSTANCE);
XAIMIcon.cbSize = sizeof(NOTIFYICONDATA);
XAIMIcon.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDR_MAINFRAME));
XAIMIcon.hWnd = m_hWnd;
strcpy(XAIMIcon.szTip, "XAIM"
;
XAIMIcon.uCallbackMessage = WM_APP + 17;
XAIMIcon.uID = IDR_MAINFRAME;
XAIMIcon.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP;
Shell_NotifyIcon(NIM_ADD, &XAIMIcon);
All the examples I can find use CALLBACK WndProc(), but I dont think I can do that in my multiple dialog MFC app. All, I'm trying to do is get the RBUTTONDOWN event. I've tried just about everything to get the callback but can't get it to work, any ideas?
NOTIFYICONDATA XAIMIcon;
HINSTANCE hInst;
hInst = (HINSTANCE)GetWindowLong(m_hWnd,GWL_HINSTANCE);
XAIMIcon.cbSize = sizeof(NOTIFYICONDATA);
XAIMIcon.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDR_MAINFRAME));
XAIMIcon.hWnd = m_hWnd;
strcpy(XAIMIcon.szTip, "XAIM"
XAIMIcon.uCallbackMessage = WM_APP + 17;
XAIMIcon.uID = IDR_MAINFRAME;
XAIMIcon.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP;
Shell_NotifyIcon(NIM_ADD, &XAIMIcon);
All the examples I can find use CALLBACK WndProc(), but I dont think I can do that in my multiple dialog MFC app. All, I'm trying to do is get the RBUTTONDOWN event. I've tried just about everything to get the callback but can't get it to work, any ideas?