当前位置: 首页 > 图文教程 > 开发语言 > VC++ > 类似于FlashGet的悬浮框的制作
| 类似于FlashGet的悬浮框的制作 下载源代码 dlg = new CSplashDlg(); dlg->Create(IDD_DIALOG1,NULL); CRect rect; dlg->GetWindowRect(&rect); //设置置顶窗口 dlg->SetWindowPos(&wndTopMost,rect.left,rect.bottom,rect.Width(),rect.Height(),SWP_SHOWWINDOW); dlg->MoveWindow(20,10,rect.Width(),rect.Height(),TRUE); dlg->ShowWindow(SW_SHOW); //显示对话框 dlg->UpdateWindow();3、关键一点在于将对话框客户去消息转换成客户区消息 void CSplashDlg::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CDialog::OnLButtonDown(nFlags, point); PostMessage (WM_NCLBUTTONDOWN , HTCAPTION , MAKELPARAM(point.x , point. y ));}4、最后不要忘了释放释放资源void CMainFrame::OnClose() { // TODO: Add your message handler code here and/or call default dlg->DestroyWindow(); //销毁对话框 CFrameWnd::OnClose();}第一次写文章,请大家多多指教,[email protected] |
评论 (0) All