About SystemTray
-
How to add an Icon to the SystemTray. When I run my application ,Application is executing (dialog based appli) as well as icon is adding to system tray. But my requirement is when I run appli., It initially added to Taskbar(tray).,When I right click on icon a menu will display . After I clicking a menu item (Start) application will Starts.(i.e,ShowWindow(SW_NORMAL)) ---- >I added code(code to adding to tray) in OnInitDialog. But It is displaying as previous . >Initially I dont want to show window. Plz Send a simple code to add an icon initially to system tray. Praveen Chowdam Kumar
-
How to add an Icon to the SystemTray. When I run my application ,Application is executing (dialog based appli) as well as icon is adding to system tray. But my requirement is when I run appli., It initially added to Taskbar(tray).,When I right click on icon a menu will display . After I clicking a menu item (Start) application will Starts.(i.e,ShowWindow(SW_NORMAL)) ---- >I added code(code to adding to tray) in OnInitDialog. But It is displaying as previous . >Initially I dont want to show window. Plz Send a simple code to add an icon initially to system tray. Praveen Chowdam Kumar
parims wrote: Initially I dont want to show window. this article will help :) http://www.voidnish.com/articles/ShowArticle.aspx?code=dlgboxtricks[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
-
How to add an Icon to the SystemTray. When I run my application ,Application is executing (dialog based appli) as well as icon is adding to system tray. But my requirement is when I run appli., It initially added to Taskbar(tray).,When I right click on icon a menu will display . After I clicking a menu item (Start) application will Starts.(i.e,ShowWindow(SW_NORMAL)) ---- >I added code(code to adding to tray) in OnInitDialog. But It is displaying as previous . >Initially I dont want to show window. Plz Send a simple code to add an icon initially to system tray. Praveen Chowdam Kumar
Declare a data member for your dialog:
NOTIFYICONDATA nid;
ThenZeroMemory(&nid,sizeof(nid)); nid.cbSize = sizeof(NOTIFYICONDATA); nid.hWnd = m_hWnd; nid.uID = 0; nid.uFlags = NIF_ICON | NIF_TIP; nid.uCallbackMessage = 0; nid.hIcon = LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_....)); lstrcpy(nid.szTip,"...some text ..."); Shell_NotifyIcon(NIM_ADD,&nid);
... and do not forget to remove the icon from tray when ready :-) SkyWalker