I := 71
SendKeys('Prg. Caption', [VK_Menu, I]);
function SendKeys(ClassOrCaption:PChar;Keys:array of Integer):Boolean;
var
hW:HWND;
Ix:Integer;
begin
Application.ProcessMessages;
hW:=FindWindow(ClassOrCaption,nil);
if hW<=0 then hW:=FindWindow(nil,ClassOrCaption);
Result:=hW>0;
if Result then begin
Result:=SetForeGroundWindow(hW);
if not Result then Exit;
for Ix:=0 to High(Keys) do KeyBd_Event(Keys[Ix], 0, 0, 0);
for Ix:=High(Keys) downto 0 do Keybd_Event(Keys[Ix], 0, KEYEVENTF_KEYUP, 0);
end;
ActivateWindow(Application.Handle);
end;
ARKA PLANDA CALISAN BIR UYGULAMAYA POSTMESSAGE ILE TUS GONDERME-02
procedure TForm1.Button1Click(Sender: TObject);
var
h: HWND;
begin
h := FindWindow(nil, 'Main Form Caption');
if h <> 0 then PostMessage(h, WM_KEYDOWN, 65,0);
end;