用C语言实现窗口抖动
#include "stdafx.h"
#include <stdio.h>
#include<Windows.h>
int main()
{ int shake_time = ; //休眠的时间,为5毫秒
int shake_distance = ; //移动了10像素
RECT rect; //RECT是一个矩形结构体,相当于保存了一个矩形的四条边的坐标
HWND window = NULL, oldwindow = NULL; //两个窗口句柄
int x, y, width, height; //用来保存窗口横纵坐标和宽度、高度的变量
int i;
//抖50次吧
for (i = ; i < ; i++) {
window = GetForegroundWindow(); //拿到活动窗口
if (window != oldwindow) {
//获取指定窗口的位置
GetWindowRect(window, &rect);
x = rect.left;
y = rect.top;
width = rect.right - x;
height = rect.bottom - y;
oldwindow = window;
}
MoveWindow(window, x - shake_distance, y, width, height, TRUE); //移动窗口,向左移动了10像素,下同
Sleep(shake_time); //休眠time毫秒,线程休眠
MoveWindow(window, x - shake_distance, y - shake_distance, width, height, TRUE);
Sleep(shake_time);
MoveWindow(window, x, y - shake_distance, width, height, TRUE);
Sleep(shake_time);
MoveWindow(window, x, y, width, height, TRUE);
Sleep(shake_time);
}
return ;
}
用C语言实现窗口抖动的更多相关文章
- C#_技巧:窗口抖动
原理 * 窗口抖动:即每隔一段很小的时间,窗口位置发生变化 * 时间控制:利用for循环||利用timer * 窗口位置发生变化:控件Left/Top属性或Location属性, 注:Left/To ...
- 转载:python原生态的输入窗口抖动+输入特效
python原生态的输入窗口抖动+输入特效 出处:https://coding.net/u/acee/p/PythonPowerInput/git/blob/master/test_power_inp ...
- 使用java语言编写窗口按钮
使用java语言编写窗口按钮 代码如下: package Day08; import java.awt.FlowLayout; import javax.swing.JButton;import ja ...
- windows编程之窗口抖动
仅仅让黑窗口抖动以供小白娱乐 #include<stdio.h> #include<windows.h> int main() { RECT rect;//RECT定义了一个矩 ...
- js 窗口抖动
<title>窗口抖动</title> <style> body{margin:50px; } #qq{position:relative;} span{paddi ...
- VC++ 实现窗口抖动
RECT rect; int x, y, nWidth, nHeight; GetWindowRect(&rect); x = rect.left; y = rect.top; nWidth ...
- C#窗口抖动
用过QQ的窗口抖动功能吧.是不是觉得很神奇?很有意思?其实,仔细想想,使用的原理还是挺简单的:让窗口的位置不断快速地发生变化. 说出了原理,是不是一下恍然大悟?顿时理解了.我以前也想过如何实现这个功能 ...
- 好玩的WPF第一弹:窗口抖动+边框阴影效果+倒计时显示文字
原文:好玩的WPF第一弹:窗口抖动+边框阴影效果+倒计时显示文字 版权声明:转载请联系本人,感谢配合!本站地址:http://blog.csdn.net/nomasp https://blog.csd ...
- 解决WPF的ScrollViewer在使用触摸屏时,滑到尽头窗口抖动的情况
原文:解决WPF的ScrollViewer在使用触摸屏时,滑到尽头窗口抖动的情况 wpf的ScrollViewer在触摸条件下 默认在尽头时会有一个窗口一起被拖动的FeedBack,但对用户的交互很不 ...
随机推荐
- 【VMware vSphere】ESXi系统设置静态IP
写在前面: 为了方便管理,一般将ESXi系统的IP设置为静态 ESXi6.5系统和6.0系统类似,这里以ESXi6.0系统为例 1, 进入系 ...
- Iterables vs. Iterators vs. Generators
Reprinted from: Iterables vs. Iterators vs. Generators Occasionally I've run into situations of conf ...
- python类的内建方法
研究email源码学到的 class test(): """Class for generating text/* type MIME documents."& ...
- EntityFramework之事务
一.EF事务 引用程序集 using System.Transactions; 用法 var writer = new System.IO.StringWriter(); try { using (v ...
- ubuntu16.04彻底删除nginx+php
1.1 删除nginx,–purge包括配置文件 sudo apt-get --purge remove nginx 1.2 自动移除全部不使用的软件包 sudo apt-get autoremove ...
- mac 上如何安装非app store上的下载的软件-------打开未知来源
打开了 Terminal 终端后 ,在命令提示后输入 sudo spctl --master-disable 并按下回车执行,如下图所示. 随后再输入当前 Mac 用户的密码,如下图所示. 如 ...
- 正版phpstorm,webstorm,goland(Jetbrains系列都可以)免费激活步骤(图文详解)(亲测有效)
1 前言 Jetbrains系列都可以,包括webstrom,phpstorm,goland等. 附加其它方案如下: webstrom(注册机) goland(破解补丁) 2 步骤 1. 可以先试用, ...
- Python中join()函数方法
函数:string.join() Python中有join()和os.path.join()两个函数,具体作用如下: join(): 连接字符串数组.将字符串.元组.列表中的元素以指定的字 ...
- 安娜Anna:世界最快的超级伸缩的KVS, 秒杀Redis
伯克利 这个大学在计算机学术界.工业界的地位举足轻重,其中的AMP实验室曾开发出了一大批大获成功. 对计算机行业产生深远影响的分布式计算技术,包括 Spark.Mesos.Tachyon 等.作为AM ...
- Oracle 行转列pivot 、列转行unpivot 的Sql语句总结
这个比较简单,用||或concat函数可以实现 select concat(id,username) str from app_user select id||username str from ap ...