功能说明:PostMessage模拟按键
procedureTForm1.Button1Click(Sender: TObject);
//模拟在Edit控件中按下a键
begin
PostMessage(Edit1.Handle, WM_KEYDOWN,65,0);
end;
procedureTForm1.Timer1Timer(Sender: TObject);
//模拟在窗体中按下Tab键
begin
PostMessage(Form1.Handle, WM_KEYDOWN, VK_TAB,0);
end;
procedureTForm1.Button2Click(Sender: TObject);
//启动Timer控件
begin
Timer1.Enabled:=true;
end;