|
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,int nCmdShow){
LPNMTTDISPINFO lpnmtdi=(LPNMTTDISPINFO)lParam;
nid.uFlags=0;
nid.cbSize=sizeof(NOTIFYICONDATA);
nid.hWnd=hwnd;
nid.uID=IDI_APPICON;
nid.hIcon=LoadIcon(hInstance,MAKEINTRESOURCE(IDI_APPICON));
nid.uFlags|=NIF_ICON;
nid.uCallbackMessage=NID_NOTIFYMSG;
nid.uFlags|=NIF_MESSAGE;
wcscpy(nid.szTip,TEXT("提示信息"));
nid.uFlags|=NIF_TIP;
Shell_NotifyIcon(NIM_ADD,&nid);//在托盘区添加图标
}
LRESULT CALLBACK MainWndProc(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam){
LPNMTTDISPINFO lpnmtdi=(LPNMTTDISPINFO)lParam;
switch (uMsg) {
case WM_NOTIFY:
switch(lpnmtdi->hdr.code){
case TTN_GETDISPINFO:
MessageBox(hwnd,TEXT("TaskmanDlgProc1 TTN_GETDISPINFO"),
TEXT("TTN_GETDISPINFO"),0);
break;
}
return FALSE;
}
} |
|