jsjl_for_ubuntu12.04
1、
VC++代码:
#include <stdio.h>
#include <windows.h>
#include <wchar.h> void MoveMouseZ(int _iX, int _iY);
HWND FindSubBtn01(HWND _hWndParent, char *pcSubWndText);
void PrintLocalTime(); void main()
{
Sleep( * );
PrintLocalTime();
printf("\t 程序开始\n"); char *pcParentWndText = "加速精灵 v2.6";
char *pcSubBtnText = "连 接"; bool bBtnConn = false; // 指示 "连 接"按钮 是否为可点击的状态
int iCounter = ;
int iCounterMoveMouse = ;
while ()
{
iCounterMoveMouse ++;
if (iCounterMoveMouse >= )
{
//*
MoveMouseZ(, );
MoveMouseZ(, );
//*/ iCounterMoveMouse = ;
}
/*
HWND hWndParent = ::FindWindowA(NULL, pcParentWndText);
if (hWndParent == 0)
{
PrintLocalTime();
printf("\t Window \"%s\" is not found .\n", pcParentWndText);
}
else
{
HWND hBtnLianJie = FindSubBtn01(hWndParent, pcSubBtnText);
if (hBtnLianJie == 0)
{
PrintLocalTime();
printf("\t Sub Button \"%s\" is not found .\n", pcSubBtnText);
}
else
{
bool bEnabled = ::IsWindowEnabled(hBtnLianJie);
if (bEnabled)
{
PrintLocalTime();
printf("\t 连接断开,即将尝试重新连接\n"); bBtnConn = true;
iCounter = 0; // 模拟 button click事件
// http://blog.sina.com.cn/s/blog_6414c87b0101892x.html
LONG idBtn = GetWindowLong(hBtnLianJie, GWL_ID);
::SendMessageA(hWndParent, WM_COMMAND, MAKEWPARAM(idBtn, BN_CLICKED), (LPARAM)hBtnLianJie);
}
else
{
if (bBtnConn)
iCounter ++; // 连续监测15次,"连 接"按钮都是不可点击的状态,则说明 貌似已经连上去了。
if (iCounter > 15)
{
PrintLocalTime();
printf("\t 貌似 已经重新连接成功\n"); bBtnConn = false;
iCounter = 0;
}
}
}
}
//*/
::Sleep();
} system("pause");
} // 找窗口"加速精灵 v2.6"下的,窗口标题为"连 接"的按钮 - 方式(1)
HWND FindSubBtn01(HWND _hWndParent, char *pcSubWndText)
{
HWND hWndLianJie = ::FindWindowExA(_hWndParent, NULL, "Button", pcSubWndText);
//printf("FindSubBtn01 : 0x%08X\n", hWndLianJie); return hWndLianJie;
} HWND g_hWndLianJie = ; BOOL CALLBACK EnumChildProc(HWND _hWndChild, LPARAM _lParam)
{
char bufText[] = {};
::GetWindowTextA(_hWndChild, bufText, sizeof(bufText));
//printf("\t%s\n", bufText);
if ( == strcmp((char*)_lParam, bufText))
{
//printf("\t\t==\n");
g_hWndLianJie = _hWndChild;
return false;
}
return true;
} // 找窗口"加速精灵 v2.6"下的,窗口标题为"连 接"的按钮 - 方式(2)
HWND FindSubBtn02(HWND _hWndParent, char *pcSubWndText)
{
EnumChildWindows(_hWndParent, EnumChildProc, (LPARAM)pcSubWndText);
return g_hWndLianJie;
} void MoveMouseZ(int _iX, int _iY)
{
// 新的 坐标点 (_iX, _iY) // 屏幕分辨率
int iX = ;
int iY = ;
// 乘数(为什么要乘以这个?暂时不知...)
int iZ = ;
//Sleep(2000);
::mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, , , , );
//Sleep(1000);
::mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, _iX * iZ / iX, _iY * iZ / iY, , );
} void PrintLocalTime()
{
//获取当地的时间。
SYSTEMTIME stLocal;
::GetLocalTime(&stLocal); //显示时间的间隔。
printf("%04u%02u%02u %02u:%02u:%02u:%u \n",
stLocal.wYear, stLocal.wMonth, stLocal.wDay,
stLocal.wHour, stLocal.wMinute, stLocal.wSecond,
stLocal.wMilliseconds);
}
2、
jsjl_for_ubuntu12.04的更多相关文章
- Python学习--04条件控制与循环结构
Python学习--04条件控制与循环结构 条件控制 在Python程序中,用if语句实现条件控制. 语法格式: if <条件判断1>: <执行1> elif <条件判断 ...
- Ubuntu 14.04中Elasticsearch集群配置
Ubuntu 14.04中Elasticsearch集群配置 前言:本文可用于elasticsearch集群搭建参考.细分为elasticsearch.yml配置和系统配置 达到的目的:各台机器配置成 ...
- win8.1硬盘安装ubuntu14.04双系统
在网上找了很多方法都失败了,原因是大多数方法都是用mbr方式安装的,如grub4dos,easybcd.以至于连自己都怀疑win8能不能用硬盘安装,差点就去买个u盘来安装了,就在打算放弃的时候在ubu ...
- 使用win10远程控制ubuntu16.04
使用win10远程控制ubuntu16.04,网上很多需要安装xfce桌面的.今天介绍一下,不需要安装其他桌面,使用Ubuntu16.04自带桌面,漂亮美观. Ubuntu16.04端: 1.打开终端 ...
- ubuntu14.04下安装node.js
在网上查了下,起初是下载了一个node-v0.12.7-linux-x64.tar.gz,解压在/home/node路径下,然后在/etc/profile中添加如下命令: export NODE_HO ...
- mono3.2和monodevelop4.0在ubuntu12.04上两天的苦战
首先第一步是设置ubuntu server 12.04版更新源,推荐中科大的比较快:deb http://debian.ustc.edu.cn/ubuntu/ precise main multive ...
- Jexus Web Server 完全傻瓜化图文配置教程(基于Ubuntu 12.04.3 64位)[内含Hyper-v 2012虚拟机镜像下载地址]
1. 前言 近日有感许多新朋友想尝试使用Jexus,不过绝大多数都困惑徘徊在Linux如何安装啊,如何编译Mono啊,如何配置Jexus啊...等等基础问题,于是昨日向宇内流云兄提议,不如搞几个配置好 ...
- Ubuntu14.04配置Mono+Jexus
总所周知,ASP.NET是微软公司的一项技术,是一个网站服务端开发的一种技术,它可以在通过HTTP请求文档时再在Web服务器上动态创建它们,就是所谓动态网站开发,它依赖运行于 IIS 之中的程序 .但 ...
- deepsooncms在Ubuntu 14.04上部署教程
deepsooncms在Ubuntu 14.04上部署教程 一.安装mono1.在命令行运行sudo apt-key adv --keyserver keyserver.ubuntu.com --re ...
随机推荐
- Android弹性滑动的三种实现方式
引言 上一篇文章我们介绍了实现弹性滑动的三种方式,但仅仅是给出了代码片段和方法理论.今天我们结合一个具体的例子来谈一下如何使用这三种方法来实现弹性滑动.今天我们的例子是仿IOS的下拉操作,我们知道An ...
- 深入浅出TCP之listen
原文:http://blog.chinaunix.net/uid-29075379-id-3858844.html int listen(int fd, int backlog); 有几个概念需要在开 ...
- css 播放器按钮实现
效果图 html代码 //播放按钮 <div id="playBtn" class="circle" style="margin: 20px 0 ...
- c#中WMI 中的日期和时间转为本地时间
取得的值:CreationDate:20170122084915 .713600+480 转: var objQuery = new ObjectQuery("select * from ...
- 172. Factorial Trailing Zeroes(阶乘中0的个数 数学题)
Given an integer n, return the number of trailing zeroes in n!. Example 1: Input: 3 Output: 0 Explan ...
- 2016-2017-2 20155309南皓芯java第五周学习总结
教材内容总结 这一周学习的进度和前几周比较的话是差不多的,都是学习两章. 异常处理 1.理解异常架构 2.牚握try...catch...finally处理异常的方法 3.会用throw,throws ...
- spring mvc interceptors
<mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/**"/> <mvc:e ...
- linux常用命令:whereis 命令
whereis命令只能用于程序名的搜索,而且只搜索二进制文件(参数-b).man说明文件(参数-m)和源代码文件(参数-s).如果省略参数,则返回所有信息. 和find相比,whereis查找的速度非 ...
- python 采坑总结 调用键盘事件后导致键盘失灵的可能原因
在练习python封装键盘事件的时候,实现一个keyDown和keyUp的功能: @staticmethod def keyDown(keyName): #按下按键 ...
- python之路----黏包的解决方案
黏包的解决方案 远程执行命令 # server 下发命令 给client import socket sk = socket.socket() sk.bind(('127.0.0.1',8080)) ...