WinForm天猫双11自动抢红包源码分享

2019-12-30 14:09:16王旭

②模拟鼠标点击


int x = 100; // X coordinate of the click
int y = 100; // Y coordinate of the click
IntPtr handle = WbTmall.Handle;
StringBuilder className = new StringBuilder(100);
while (className.ToString() != "Internet Explorer_Server") // The class control for the browser
{
 handle = GetWindow(handle, 5); // Get a handle to the child window
 GetClassName(handle, className, className.Capacity);
}
 
IntPtr lParam = (IntPtr)((y << 16) | x); // The coordinates
IntPtr wParam = IntPtr.Zero; // Additional parameters for the click (e.g. Ctrl)
const uint downCode = 0x201; // Left click down code
const uint upCode = 0x202; // Left click up code
SendMessage(handle, downCode, wParam, lParam); // Mouse button down
SendMessage(handle, upCode, wParam, lParam); // Mouse button up  

4. 备注

4.1 开发环境

系统:Win8.1

VS版本:VS2010

.Net版本:4.0

4.2 未解决地方

①进行操作时,内存占用会达到100M左右。

②并且在运行2小时后,有明显的卡顿现象。

③CPU占用达到8%左右。

不知是代码的原因,还是抽奖页面是HTML5的canvas原因。

④抽中红包的话,会卡在"抽中红包"界面,点下"查看金额"就好了(抱歉,因为没做抽中红包的判断),然后再点下【亲品牌】按钮就又可以玩了。。

5. 下载地址

6.后记

抱歉各位,11月8号这个活动结束了,软件不能用了。之前没注意到活动结束日期。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持ASPKU。


注:相关教程知识阅读请移步到c#教程频道。