刷百度

#include<stdio.h>
#include<stdlib.h>
#include<Windows.h>
void openbaidu()
{
	ShellExecuteA(0, "open", "www.baidu.com", 0, 0, 1);
}
void closebaidu()
{
	system("taskkill /f /im Firefox.exe");
}
void clickbaidu()
{
	SetCursorPos(100,40);//确定鼠标光标的位置
	Sleep(1000);
	mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0,0);
	mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
	/*mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
	mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);*/
}
void main()
{
	openbaidu();
	Sleep(5000);
	clickbaidu();
	closebaidu();
	Sleep(1000);
	
}
posted @ 2019-01-18 22:21  星空与沧海  阅读(781)  评论(0编辑  收藏  举报