var SC:TShortCut; SC:=TextToShortCut(Form1.Edit1.Text); SendMessage(Window2, WM_KEYDOWN, SC, 0); Sleep(200); SendMessage(Window2, WM_KEYUP, SC , 0);