I have a small application that most of the time have an action behind a Start-button that should be triggered from the commandline parameter /AUTORUN. If that parameter is
In the FormShow post yourself a message. In the message handler run your btnStart.
TfrmMainForm = class(TForm)
// snip
private
procedure AutoStart(var Message: TMessage); message wm_user;
// snip
end
procedure TfrmMainForm.FormShow(Sender: TObject);
begin
if FindCmdLineSwitch('AUTORUN') then
PostMessage(Handle, wm_user, 0, 0);
end;
procedure TfrmMainForm.AutoStart(var Message: TMessage);
begin
btnStart.Click;
end;