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
|
#include <windows.h>
void kout(char * kp)
{
int length=strlen(kp);
for(int i=0;i<length;i++)
{
keybd_event(VkKeyScan(kp[i]),0,0,0); //depress
keybd_event(VkKeyScan(kp[i]),0, KEYEVENTF_KEYUP,0); // release!
}
keybd_event(VK_RETURN,0x0D,0,0); //enter depress!
keybd_event(VK_RETURN,0x0D, KEYEVENTF_KEYUP,0); // enter release!
Sleep( 100 );
}
void kcout(char single) // we're going to call this function many times
// and then a function to press [RETURN]
{
keybd_event(VkKeyScan(single),0,0,0); //depress
keybd_event(VkKeyScan(single),0, KEYEVENTF_KEYUP,0); // release!
}
void ret()
{
keybd_event(VK_RETURN,0x0D,0,0); //enter depress!
keybd_event(VK_RETURN,0x0D, KEYEVENTF_KEYUP,0); // enter release!
}
|