Query about Tray Icon
-
Hi all, I have developed a dialog based application. In CMyDialog::OnInitDialog() i wrote code to add TrayIcon. HICON hIcon = NULL; m_NotifyIconData.cbSize = sizeof(NOTIFYICONDATA); m_NotifyIconData.hWnd = m_hWnd; m_NotifyIconData.uID = IDR_MAINFRAME; m_NotifyIconData.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; m_NotifyIconData.uCallbackMessage = ID_TRAY_MESSAGE; //WM_USER + 1 hIcon = (HICON) LoadIcon(AfxGetInstanceHandl(),MAKEINTRESOURCE (IDR_MAINFRAME)); m_NotifyIconData.hIcon = hIcon; strcpy(m_NotifyIconData.szTip, "My Tray Icon"); Shell_NotifyIcon(NIM_ADD, &m_NotifyIconData); if (hIcon) DestroyIcon(hIcon); It successfully added Tray Icon to the Notification area. My sample application is running well. But, when i kill windows "explorer.exe" process from task manager and start "explorer" again, TrayIcon is missing in Notification area. I want Tray icon to be added again in this scenario. How to do this? Thank you...
-
Hi all, I have developed a dialog based application. In CMyDialog::OnInitDialog() i wrote code to add TrayIcon. HICON hIcon = NULL; m_NotifyIconData.cbSize = sizeof(NOTIFYICONDATA); m_NotifyIconData.hWnd = m_hWnd; m_NotifyIconData.uID = IDR_MAINFRAME; m_NotifyIconData.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; m_NotifyIconData.uCallbackMessage = ID_TRAY_MESSAGE; //WM_USER + 1 hIcon = (HICON) LoadIcon(AfxGetInstanceHandl(),MAKEINTRESOURCE (IDR_MAINFRAME)); m_NotifyIconData.hIcon = hIcon; strcpy(m_NotifyIconData.szTip, "My Tray Icon"); Shell_NotifyIcon(NIM_ADD, &m_NotifyIconData); if (hIcon) DestroyIcon(hIcon); It successfully added Tray Icon to the Notification area. My sample application is running well. But, when i kill windows "explorer.exe" process from task manager and start "explorer" again, TrayIcon is missing in Notification area. I want Tray icon to be added again in this scenario. How to do this? Thank you...
ramana.g wrote:
How to do this?
By reading this article.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
ramana.g wrote:
How to do this?
By reading this article.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne