Re: click associated file and open prog and load file


[ DelphiLand FAQ ]

Posted by Joey on April 05, 2004 at 23:31:08:

In Reply to: Re: click associated file and open prog and load file posted by jnp on April 05, 2004 at 21:55:44:

Ahhh okey well try this:

procedure TForm1.FormShow(Sender: TObject);
begin
Memo1.Clear;
if ParamCount > 0 then
begin
case ParamCount of
1: Memo1.Lines.LoadFromFile(Paramstr(1));
// allow for other possible parameter counts here
else
begin
ShowMessage('Invalid Parameters');
Application.Terminate;
end;
end;
end;

You will have to edit it to what you want to do but this lets ur app accept command lines :D

Hope this helps!

CODE TAKEN FROM [htp://www.delphicorner.f9.co.uk/tips.htm#FileParam]


Related Articles and Replies:



[ DelphiLand: free Delphi source code, tips, tutorials ]