To do this kind of thing I usually just add a message to the message
queue and then respond to the message.

Something like


Const 
 WM_MYMESSAGE = WM_USER + 1

Type TfrmMain = class (TForm)
    procedure FormShow(Sender: TObject);
private 
protected
    procedure WMMyMessage(var Message: TMessage); message
      WM_MYMESSAGE;     
public
end;

procedure TfrmMain.WMMyMessage (var Message: TMessage);
begin
  FCoreManager.LoadCoreEngineAndPlugIns(True);
  PlugInManager.DoShowDockedWindow := DoShowDockedWindow;
  actFileLogin.Execute;
end;

procedure TfrmMain.FormShow(Sender: TObject);
begin
      PostMessage(Handle, WM_BLAFTERSHOW, 0, 0);
end;

Hope this helps.

Peter Speden
 

-----Original Message-----
From: Alistair George [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 26 February 2003 7:19 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Paramstr(1)

Passing  command  line  to the app is easy. But unfortunately there is a
problem
that the form is not created yet, so you cannot pass parameters to the
component
settings (my parameter contains a bunch of settings).
The obvious easy solution would be to start a timer in the program which
fires a
few  ms  after  formcreate  has  finished,  checking to see if
paramstr(1) has a
relevant  string, but that is too easy and a waste of a timer. Is there
anything
else I can do which is more program-sense?
I prefer that the form is not visible at all. But the call would still
have to
wait till all controls are enabled before progressing to the settings
area.

Thanks,
Alistair+

------------------------------------------------------------------------
---
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to