MFC右下角弹出提醒框

//右下角弹出框
void CEmailSendDlg::DisplayTips(CString str)
{ 
  g_pCboutDlg = new CAboutDlg;  
  g_pCboutDlg->m_strTips = str;
  g_pCboutDlg->Create(IDD_ABOUTBOX);
  g_pCboutDlg->ShowWindow(SW_HIDE);
CRect rc;
CRect rc_pop;
SystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID)&rc,0);
g_pCboutDlg->GetWindowRect(&rc_pop);
rc.left = rc.right - rc_pop.Width();
rc.top = rc.bottom - rc_pop.Height();
//设置弹出窗口在顶层显示
::SetWindowPos(g_pCboutDlg->GetSafeHwnd(), HWND_TOPMOST, rc.left,rc.top, rc_pop.Width(), rc_pop.Height(), NULL);
//dlg->MoveWindow(&rc);
    ::AnimateWindow(g_pCboutDlg->GetSafeHwnd(), 6000, AW_SLIDE | AW_BLEND | AW_ACTIVATE);
MSG msg;                              //如果是非模态对话框一定要加入这个消息循环
while(GetMessage (&msg, NULL, 0, 0 )) //模态对话就不要了,因为DoModal内部执行了这
{                                     //个工作
TranslateMessage (&msg);          //只要是子线程中要创建窗口都要有一个消息循环
DispatchMessage (&msg);     
}
}


展开阅读全文

没有更多推荐了,返回首页