Time:10-09
CodePudding user response:
http://babybandf.blog.163.com/blog/static/61993532009121899788/
# define MY_NOTIFYICON (WM_USER + 200) NOTIFYICONDATA data=https://bbs.csdn.net/topics/{0}; Data. The cbSize=sizeof (NOTIFYICONDATA) Data. HIcon=: : LoadImage (NULL, _T (" res \ \ hanky-panky. ICO "), IMAGE_ICON, 32, 32, LR_LOADFROMFILE);//to check the LoadImage this API Data. The hWnd=hMainWnd;//tray icon of the form Data. The uID=31000;//tray icon ID, you specify, generally set to form the ID value of the Data. UFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP;//tray icon structure attribute Data. The uCallbackMessage=MY_NOTIFYICON;//set the tray icon click message //... //... Shell_NotifyIcon (NIM_ADD, & amp; The data); //... //...
NOTIFYICONDATA structure in the body is not a hIcon variables, you give the assignment not good # define MY_NOTIFYICON (WM_USER + 200) NOTIFYICONDATA data=https://bbs.csdn.net/topics/{0}; Data. The cbSize=sizeof (NOTIFYICONDATA) Data. HIcon=: : LoadImage (NULL, _T (" res \ \ hanky-panky. ICO "), IMAGE_ICON, 32, 32, LR_LOADFROMFILE);//to check the LoadImage this API Data. The hWnd=hMainWnd;//tray icon of the form Data. The uID=31000;//tray icon ID, you specify, generally set to form the ID value of the Data. UFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP;//tray icon structure attribute Data. The uCallbackMessage=MY_NOTIFYICON;//set the tray icon click message //... //... Shell_NotifyIcon (NIM_ADD, & amp; The data); //... //...
Quote: refer to 4th floor HHeellooword response: Casting... HICON HICON=(HICON) LoadImage (... );
Page link:https//www.codepudding.com/Softwareengineering/58605.html