BOOL CBell4Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen
// TODO: Add extra initialization here
//系统托盘
NOTIFYICONDATA tnd;
tnd.cbSize=sizeof(NOTIFYICONDATA);
tnd.hWnd=this->m_hWnd;
tnd.uID=IDI_ICON;
tnd.uFlags=NIF_MESSAGE|NIF_ICON|NIF_TIP;
tnd.uCallbackMessage=WM_NC;
//用户自定义的消息,即鼠标在任务栏上程序图标上动作时图标发送的消息
tnd.hIcon=m_hIcon;
wcscpy(tnd.szTip,L"Left Click To Main Frame");
//图标提示为”单击打开主界面”。貌似没有用。。。悲剧
Shell_NotifyIcon(NIM_ADD,&tnd);//向系统托盘添加图标
//end系统托盘!
......
}