#include<windows.h>
#include<cstdlib>
#include<bits/stdc++.h>
#include<ctime>
using namespace std;
string cmd = "CMD";
int main()
{
int x=GetSystemMetrics(SM_CXSCREEN);
int y=GetSystemMetrics(SM_CYSCREEN);
srand(time(0));
int xx=225;
int yy=681;
for(int i=1;i<=200;i++){
xx-=1;
yy+=1;
SetCursorPos(xx,yy);
Sleep(10);
}
mouse_event(MOUSEEVENTF_LEFTDOWN,xx,yy,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,xx,yy,0,0);
keybd_event(cmd[0], 0, 0, 0);
keybd_event(cmd[0], 0, 2, 0);
Sleep(100);
keybd_event('M', 0, 0, 0);
keybd_event('M', 0, 2, 0);
Sleep(100);
keybd_event('D', 0, 0, 0);
keybd_event('D', 0, 2, 0);
Sleep(100);
keybd_event(VK_RETURN,0,0,0);
keybd_event(VK_RETURN,0,KEYEVENTF_KEYUP,0);
Sleep(1000);
keybd_event('S', 0, 0, 0);
keybd_event('S', 0, 2, 0);
Sleep(100);
keybd_event('H', 0, 0, 0);
keybd_event('H', 0, 2, 0);
Sleep(100);
keybd_event('U', 0, 0, 0);
keybd_event('U', 0, 2, 0);
Sleep(100);
keybd_event('T', 0, 0, 0);
keybd_event('T', 0, 2, 0);
Sleep(100);
keybd_event('D', 0, 0, 0);
keybd_event('D', 0, 2, 0);
Sleep(100);
keybd_event('O', 0, 0, 0);
keybd_event('O', 0, 2, 0);
Sleep(100);
keybd_event('W', 0, 0, 0);
keybd_event('W', 0, 2, 0);
Sleep(100);
keybd_event('N', 0, 0, 0);
keybd_event('N', 0, 2, 0);
Sleep(100);
keybd_event(VK_SPACE, 0, 0, 0);
keybd_event(VK_SPACE, 0, 2, 0);
Sleep(100);
keybd_event(VK_SPACE, 0, 0, 0);
keybd_event(VK_SPACE, 0, 2, 0);
Sleep(100);
keybd_event(VK_OEM_MINUS,0,0,0);
keybd_event(VK_OEM_MINUS,0,2,0);
Sleep(100);
keybd_event('P',0,0,0);
keybd_event('P',0,2,0);
Sleep(100);
keybd_event(VK_RETURN,0,0,0);
keybd_event(VK_RETURN,0,KEYEVENTF_KEYUP,0);
Sleep(100);
keybd_event(VK_RETURN,0,0,0);
keybd_event(VK_RETURN,0,KEYEVENTF_KEYUP,0);
return 0;
}
共 2 条回复
第二个是鼠标移动到最左边?
第一个可能会导致死机,第二个还在尝试中。