zoukankan      html  css  js  c++  java
  • MFC实现 MSN QQ 窗口抖动

    //转载自网友
    void CWindouDlg::OnButton1()
    {
     // TODO: Add your control notification handler code here
    PlaySound(MAKEINTRESOURCE(IDR_WAVE1),AfxGetResourceHandle(),SND_ASYNC|
        SND_RESOURCE|SND_NODEFAULT);//使用PlaySound需要包含头文件 Header: Declared in mmsystem.h.
                                    //Import Library: Use winmm.lib.
     int ty=7;
     CRect   m_rect;  
     GetWindowRect(&m_rect);  
     for(int i=0;i<70;i++)
     {
     SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );
      m_rect.top = m_rect.top + ty; 
      m_rect.left = m_rect.left - ty;
      SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );
      m_rect.top = m_rect.top - ty; 
      m_rect.left = m_rect.left + ty;
      SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );
      m_rect.top = m_rect.top - ty; 
      m_rect.left = m_rect.left + ty;
      SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );
      m_rect.top = m_rect.top + ty; 
      m_rect.left = m_rect.left - ty;
      SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );
     }
    }
    //修改后
     int ty=5;
     CRect   m_rect;  
     GetWindowRect(&m_rect); 
     int recordy=m_rect.left;
     int recordx=m_rect.top;
    for(int i=0;i<3;i++)
     {
        m_rect.left=recordy;
        m_rect.top=recordx;
        m_rect.top = m_rect.top + ty; 
        m_rect.left = m_rect.left - ty;
        SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );Sleep(35);
        m_rect.top = m_rect.top -ty;
        SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );Sleep(35);
        m_rect.top = m_rect.top -2*ty;
        SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );Sleep(35);
        m_rect.left=m_rect.left+ty;
        SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );Sleep(35);
        m_rect.left=m_rect.left+2*ty;
        SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );Sleep(35);
        m_rect.top = m_rect.top + ty; 
        SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );Sleep(35);
        m_rect.top=m_rect.top+2*ty;
        SetWindowPos( NULL,m_rect.left,m_rect.top,0,0,SWP_NOSIZE );
        SetWindowPos( NULL,recordy,recordx,0,0,SWP_NOSIZE );
        Sleep(35);
      }
  • 相关阅读:
    React Native 开发豆瓣评分(三)集成 Redux
    React Native 开发豆瓣评分(二)路由配置
    React Native 开发豆瓣评分(一)环境搭建&配置模拟器
    VSCode 搭建 React Native 环境
    webpack4 + ejs 构建多页应用
    react-native 沉浸式状态栏
    react-native——tab配置及跳转
    uni-app 入门之 nvue (weex) 爬坑记
    javascript中bind()、call()、apply()的使用
    mysql数据库中文乱码配置文件解决以及常见mysql命令
  • 原文地址:https://www.cnblogs.com/AkQuan/p/2685883.html
Copyright © 2011-2022 走看看