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;




你可能感兴趣的:(message)