1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#include "stdafx.h"
#include <iostream>
#include <windows.h>
using namespace std;
void Type(string,string, int);
int main()
{
for(int i = 1; i < 25; i++)
{
string mes("abc");
string sub("a b c a b c a b c");
Type(sub,mes,i);
Sleep(10000);
}
system("pause");
return 0;
}
void Type(string sub, string mes, int i)
{
int sublength = sub.length();
for(int a = 0; a < sublength; a++)
{
if(sub[a] == 'a')
{
keybd_event(97, 0, 0, 0);
}
else if(sub[a] == 'b')
{
keybd_event(98, 0, 0, 0);
}
else if(sub[a] == 'c')
{
keybd_event(99, 0, 0, 0);
}
}
)
|