29-07-2017, 03:48 PM
السلام عليكم
هذا يلبي طلبك
هذا يلبي طلبك
PHP كود :
uses
ShellAPI;
procedure ClickButton(WindowName, WindowCaption, ControlName, ControlCaption: PChar);
var
hParent, hControl: HWND;
begin
hParent := 0;
hControl := 0;
hParent := FindWindow(WindowName, WindowCaption);
try
BringWindowToTop(hParent);
Application.ProcessMessages;
hControl := FindWindowEx(hParent, 0, ControlName,
ControlCaption);
try
SendMessage(hControl, BM_CLICK, 0, 0);
finally
hControl := 0;
end;
finally
hParent := 0;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Application.Handle, 'Open', 'C:\Target.exe', nil, nil, SW_SHOWDEFAULT);
//Sleep(100);
ClickButton(nil, 'Ingstart', nil, 'Start');
end;
سبحان الله وبحمده سبحان الله العظيم

