UINT GETNOTIFY=RegisterWindowMessage(_T("lfkjwoeriu293847,cnxvb")); //添加消息号
BEGIN_MESSAGE_MAP(CEInputDlg, CDialog) //添加映射
ON_REGISTERED_MESSAGE(GETNOTIFY,myNotify)
ON_WM_SIZE()
END_MESSAGE_MAP()
LRESULT CEInputDlg::myNotify(WPARAM wParam, LPARAM lParam) //消息回送事件
{
UINT uMouseMsg = (UINT) lParam;
if (uMouseMsg == WM_LBUTTONDBLCLK)
{
this->DeleteNotify();
this->ShowWindow(SW_SHOW);
this->ShowWindow(SW_SHOWNORMAL);
}
return NULL;
}
void CEInputDlg::AddNotify()//添加提示
{
NOTIFYICONDATA notify;
notify.cbSize=sizeof(NOTIFYICONDATA);
notify.hWnd=this->m_hWnd;
notify.hIcon=this->m_hIcon;
notify.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
notify.uCallbackMessage = GETNOTIFY;
notify.uID=IDR_MAINFRAME;
this->GetWindowTextW(notify.szTip,128);
Shell_NotifyIcon(NIM_ADD,¬ify);
}
void CEInputDlg::DeleteNotify() //删除提示
{
NOTIFYICONDATA notify;
notify.cbSize = sizeof(NOTIFYICONDATA);
notify.hWnd = this->m_hWnd; ;
notify.uID = IDR_MAINFRAME;
Shell_NotifyIcon(NIM_DELETE, ¬ify);
}