zoukankan      html  css  js  c++  java
  • 模拟QQ窗口抖动效果(通过MoveWindow和Sleep进行模拟)

    [cpp] view plain copy
     
    1. RECT rtWindow;  
    2.     GetWindowRect(&rtWindow);  
    3.     //long x = 400;  
    4.     //long y = 200;  
    5.     long x = rtWindow.left;  
    6.     long y = rtWindow.top;  
    7.     long cxWidth = rtWindow.right-rtWindow.left;  
    8.     long cyHeight = rtWindow.bottom-rtWindow.top;  
    9.     const long nOffset  = 9;  
    10.     const long SLEEP_INTERAL = 60;  
    11.       
    12.     for(long i=0; i<=2; ++i)  
    13.     {  
    14.         ::MoveWindow(m_hWnd, x+nOffset, y-nOffset, cxWidth, cyHeight, TRUE);  
    15.         ::Sleep(SLEEP_INTERAL);  
    16.         ::MoveWindow(m_hWnd, x-nOffset, y-nOffset, cxWidth, cyHeight, TRUE);  
    17.         ::Sleep(SLEEP_INTERAL);  
    18.         ::MoveWindow(m_hWnd, x-nOffset, y+nOffset, cxWidth, cyHeight, TRUE);  
    19.         ::Sleep(SLEEP_INTERAL);  
    20.         ::MoveWindow(m_hWnd, x+nOffset, y+nOffset ,cxWidth, cyHeight, TRUE);  
    21.         ::Sleep(SLEEP_INTERAL);  
    22.         ::MoveWindow(m_hWnd, x, y, cxWidth, cyHeight, TRUE);  
    23.         ::Sleep(SLEEP_INTERAL);  
    24.     }  

    参考:http://www.rupeng.com/forum/thread-6423-1-1.html

    http://blog.csdn.net/analogous_love/article/details/47979739

  • 相关阅读:
    Extjs combobox设置默认值
    sql 游标循环遍历
    .NET中的DES对称加密
    Asp.Net生命周期
    浅谈C#随机数发生器
    面向对象-多态 附抽象
    c#常用的一些命名空间
    c#面向对象编程基础
    string应用
    [自习任我行]第二阶段任务跟踪10
  • 原文地址:https://www.cnblogs.com/findumars/p/7128402.html
Copyright © 2011-2022 走看看