c++ 代码 使窗体震动,实现最前提醒
来源:互联网 发布:软件 漏洞 编辑:程序博客网 时间:2024/05/16 18:25
#ifndef DEBUG_DISABLE#define DEBUG_ENTERED(M) MessageBox(NULL,\M,\"Tip",\MB_OK);#else#define DEBUG_ENTERED(M) #endifBOOLShockWindow(HWND hWindow,DWORD dwDelayTime/*ms*/,DWORD dwShockTimes,DWORD dwSpan,BOOL bStayTop);
BOOLShockWindow(HWND hWindow,DWORD dwDelayTime,DWORD dwShockTimes,DWORD dwSpan,BOOL bStayTop){//get the information of the windowRECT rect;GetWindowRect(hWindow,&rect);//valid?if(!hWindow){DEBUG_ENTERED("Can not find window!")return FALSE;}else{ShowWindow(hWindow,SW_NORMAL);DEBUG_ENTERED("ENTER PROCESSING")//if window is minimize,without this statement ,will cause the window hideGetWindowRect(hWindow,&rect);//on topSetWindowPos(hWindow,HWND_TOPMOST,rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,SWP_NOSIZE|SWP_NOMOVE);//start shockfor(int i=0;i<dwShockTimes;++i){MoveWindow(hWindow,rect.left+dwSpan,rect.top,rect.right-rect.left,rect.bottom-rect.top,TRUE);Sleep(dwDelayTime);MoveWindow(hWindow,rect.left,rect.top-dwSpan,rect.right-rect.left,rect.bottom-rect.top,TRUE);Sleep(dwDelayTime);MoveWindow(hWindow,rect.left-dwSpan,rect.top,rect.right-rect.left,rect.bottom-rect.top,TRUE);Sleep(dwDelayTime);MoveWindow(hWindow,rect.left,rect.top+dwSpan,rect.right-rect.left,rect.bottom-rect.top,TRUE);Sleep(dwDelayTime);}//back to original positionMoveWindow(hWindow,rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,TRUE);//weather the window want to be on top PS:now it is on topif(!bStayTop){SetWindowPos(hWindow,HWND_NOTOPMOST,rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,SWP_NOSIZE|SWP_NOMOVE);}DEBUG_ENTERED("ENTER ENDING")return TRUE;}}
- c++ 代码 使窗体震动,实现最前提醒
- c#实现震动窗体
- 使窗体总在最前
- [C#]实现盯桌面,最底层窗体
- 【转】Android震动实现代码
- 【android开发】获取情景模式和铃声,实现震动/铃声提醒
- 窗体总在最前
- 如何使窗体保持在最前 windows函数使用
- 实现窗体自动隐藏(c代码)
- paip.c#.net 设置窗体关闭提醒
- 仿MSN,QQ窗体震动的功能 (C#)
- notification..消息提醒,有震动提醒效果
- 实现窗体隐藏代码实例(C代码)
- 总在最前的窗体
- java 震动提示窗体
- GPS闹钟(实现基本定位,添加marker以及实现震动提醒)
- C#,代码,移动窗体
- iOS实现手机的连续震动和停止震动的代码(拷如工程就能用)
- Android查看数据库
- Dart 语言惯用语——Dart中特有的代码味道
- ActiveMQ 3
- iphone开发把地址转换为地图经纬度 已解决不支持中文bug
- 菠菜 宜or不宜
- c++ 代码 使窗体震动,实现最前提醒
- 【转载】使用 Java 实现 Comet 风格的 Web 应用
- 提高PHP编程效率的53个要点
- curl应用总结(二)
- webkit 源码分析之加载默认的css文件
- linux下vim配置
- 一道java笔试题,如何截取带有汉字的字符串
- Linux下可插入验证模块
- GlusterFS集群文件系统研究