SendMessage 循环按1 到6 F1到F8_2

//循环按1 到6 F1到F8 
procedure TForm1.Timer1Timer(Sender: TObject);
var
  wmHwnd:HWND;
  i:integer;
begin
    wmHwnd:=FindWindow(nil,'Element Client');
    for i := 49 to 54 do //键1到1键6
    begin
      SendMessage(wmHwnd,WM_KEYDOWN,i,0);
      SendMessage(wmHwnd,wm_keyup,i,0);
    end;
    for i := 112 to 119 do //键F1 到键F8
    begin
      SendMessage(wmHwnd,WM_KEYDOWN,i,0);
      SendMessage(wmHwnd,wm_keyup,i,0);
    end;
end;




posted @ 2012-06-03 17:55  XE2011  阅读(170)  评论(0编辑  收藏  举报