主题:模拟按不下键
我试过了,用这两种方法都能在游戏的聊天框中按下字母A,,但就是按F5,F6这样的键不行,不知道怎么回事??
if(testhong<strtoint(edit3.text)) then
begin
postmessage(Thwnd,WM_KEYDOWN,117,0);
postmessage(Thwnd,WM_KEYUP,117,0);
end
=========================
if(testlan<strtoint(edit3.text)) then
begin
keybd_event(116,0,0,0);
keybd_event(116,0,KEYEVENTF_KEYUP,0);
end
if(testhong<strtoint(edit3.text)) then
begin
postmessage(Thwnd,WM_KEYDOWN,117,0);
postmessage(Thwnd,WM_KEYUP,117,0);
end
=========================
if(testlan<strtoint(edit3.text)) then
begin
keybd_event(116,0,0,0);
keybd_event(116,0,KEYEVENTF_KEYUP,0);
end