Posted by John Doe on January 17, 2003 In Reply to: Re: Howcan I make a program with COMMAND LINE options. posted by webmaster Guido on October 18, 2002 This seem to work 'pretty' well, I made this dirty hack for a win2k box while I was writing a simple editor. The idea was to open multiple files at once with this 'right-click' registry entry [HKEY_CLASSES_ROOT\*\shell\MyProgram\Command] and this is the snippet that made it happen procedure TfrmMain.FormShow(Sender: TObject); var i: integer; begin {Check to see if we need to load files from commandline} if ParamCount > 0 then for i := 1 to ParamCount do begin if FileExists(ParamStr(i)) then OpenFile(ParamStr(i)); end else FileNew.Execute; end; Pretty self-explanetory ey? I later had some headaches with opening multiple files succcessfully BUT with a cryptic exception when I closed the program. It may have been due to some other bug however.
Find related articles Suggested keywords: |
|