unsigned char str=buffer[0];
(int)str;
keybd_event(str,0,0,0);
keybd_event(str,0,KEYEVENTF_KEYUP,0);
用此函数来响应收到的字符并作出模拟按键,如果输入的是大写字母A则相应的模拟按键也为A,但是若按下小写a,则模拟按键响应为1???
SHORT ks = VkKeyScan(str);
BYTE key = ks & 0xFF;
keybd_event(key,0,0,0);
keybd_event(key,0,KEYEVENTF_KEYUP,0);
就可以了