QQ消息窗口实现
2009-07-22 22:35
225 查看
【转载】用VC++制作MSN、QQ 的消息提示窗口
2008-05-29 22:54
以上是我转载的,然后我就照着文章的思路写了个模仿QQ消息弹出框的程序:
1.在VS中建一个基于对话框的模板的程序
2.在对话框的属性一栏中,将Tool Window和Topmost置true
3.重写OnInitDialog():
2008-05-29 22:54
用过QQ和MSN聊天工具的人都知道,只要好友上线,就会在托盘的位置处显示一个提示窗口,以是拉帘式的,或者是淡入淡出的形式出现;想想何不为自己的程式也加一个漂亮的提示窗口呢? 一、MSN拉帘式窗口制作 分三部分:1、窗口的显示;2、窗口的停留;3、窗口的消失; 如果达到这样郊果,系统中要有三个定时器,进行分别控制。定义的定时器如下:
二、QQ淡出淡出显示实现 其实用到一个API函数:AnimateWindow,下面是这个函数的一些说明:
各种标志说明:
三、控制窗口显示的代码
|
1.在VS中建一个基于对话框的模板的程序
2.在对话框的属性一栏中,将Tool Window和Topmost置true
3.重写OnInitDialog():
BOOL CMyDlg::OnInitDialog() { CDialog::OnInitDialog(); // 将“关于...”菜单项添加到系统菜单中。 // IDM_ABOUTBOX 必须在系统命令范围内。 ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { BOOL bNameValid; CString strAboutMenu; bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); ASSERT(bNameValid); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动 // 执行此操作 SetIcon(m_hIcon, TRUE); // 设置大图标 SetIcon(m_hIcon, FALSE); // 设置小图标 // TODO: 在此添加额外的初始化代码 CRect rect,rect2; ::SystemParametersInfo(SPI_GETWORKAREA,0,&rect,0); GetWindowRect(&rect2); //下面用MoveWindow,不要用SetWindowPos,不然效果不对 MoveWindow(rect.right-rect2.Width(),rect.bottom-rect2.Height(),rect2.Width(),rect2.Height()); ShowWindow(SW_HIDE); ::SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE,WS_EX_TOOLWINDOW); AnimateWindow(3000,AW_BLEND);//窗口淡化效果 return TRUE; // 除非将焦点设置到控件,否则返回 TRUE }
相关文章推荐
- WinForm:实现类似QQ消息框一样的右下角消息提示窗口
- MFC实现类似qq的在屏幕右下角动画显示消息窗口
- QQ收到消息窗口闪烁效果实现[C#]
- winforms实现类似QQ消息框一样的右下角消息提示窗口
- Java Swing实现的仿QQ气泡消息聊天窗口效果
- 仿QQ、MSN消息提示窗口的实现(C#)
- MFC实现类似qq的在屏幕右下角动画显示消息窗口 .
- 如何实现qq的那种有消息过来,窗口就在任务栏闪的效果?
- C#实现相似QQ的隐藏浮动窗口、消息闪动
- winforms实现类似QQ消息框一样的右下角消息提示窗口
- electron实现类似QQ来新消息时的闪烁与任务栏窗口提醒
- winforms实现类似QQ消息框一样的右下角消息提示窗口
- QQ风格淡入淡出消息提示窗口的实现(WinForm)
- C#实现仿QQ消息窗口
- winforms实现类似QQ消息框一样的右下角消息提示窗口
- VC 某窗口向其他窗口发送消息实现步骤
- C#实现类似QQ的任务栏通知窗口
- 易语言界面库的实现(二)消息预处理 和窗口生存周期。
- Socket编程 消息传送 TCP协议(窗口实现) 客户端
- 利用DecorView实现播放视频开灯/关灯效果和仿QQ消息提示框