typedef struct _NOTIFYICONDATA { …… }NOTIFYICONDATA, *PNOTIFYICONDATA; MembershWnd Handle to the window that receives notification messages associated with an icon in the taskbar status area. The Shell uses hWnd and uID to identify which icon to operate on when Shell_NotifyIcon is invoked. uID Application-defined identifier of the taskbar icon. The Shell uses hWnd and uID to identify which icon to operate on when Shell_NotifyIcon is invoked. You can have multiple icons associated with a single hWnd by assigning each a different uID. 窗口句柄容易得到但是你怎么获取其他程序指定的ID?
First,you should get the application's handle(hwnd). Second,you should know the ID of the application's icon. Then you can use the Shell_NotifyIcon(NIM_DELETE,&tnd) to hide the icon which you want.
like this:NOTIFYICONDATA tnd; tnd.cbSize=sizeof(NOTIFYICONDATA); tnd.hWnd=handleoficon; tnd.uID=IDoficon; Shell_NotifyIcon(NIM_DELETE,&tnd);That's OK!
in its main menu, system parameters
参数设置 tab
不要选“载任务栏显示图标”
DWORD cbSize;
HWND hWnd;
UINT uID;
UINT uFlags;
UINT uCallbackMessage;
HICON hIcon;
char szTip[64];
} NOTIFYICONDATA, *PNOTIFYICONDATA;的一个数据域“hWnd”,获得 QQ的窗口句柄先,给这个域,然后Shell_NotifyIcon(NIM_DELETE , XXX);
应该可以了吧。
……
}NOTIFYICONDATA, *PNOTIFYICONDATA;
MembershWnd Handle to the window that receives notification messages associated with an icon in the taskbar status area. The Shell uses hWnd and uID to identify which icon to operate on when Shell_NotifyIcon is invoked.
uID
Application-defined identifier of the taskbar icon. The Shell uses hWnd and uID to identify which icon to operate on when Shell_NotifyIcon is invoked. You can have multiple icons associated with a single hWnd by assigning each a different uID.
窗口句柄容易得到但是你怎么获取其他程序指定的ID?
能给出实现源码最好了。谢谢谢谢。急啊!!!!
http://realcyi.myetang.com/dah/hideqq.exe
Second,you should know the ID of the application's icon.
Then you can use the Shell_NotifyIcon(NIM_DELETE,&tnd) to hide the icon which you want.
tnd.cbSize=sizeof(NOTIFYICONDATA);
tnd.hWnd=handleoficon;
tnd.uID=IDoficon;
Shell_NotifyIcon(NIM_DELETE,&tnd);That's OK!