Command line args to a GUI app?
Quote
Phil V wrote:
> Where in my Windows Gui program do I pick up the command line arguments
> passed to it and how?
In unit System you have available CmdLine, ParamCount and ParamStr[index].
<quote from Borland help file>
The following example beeps once for each beep passed in on the
command line. The example terminates the application if exit is
passed in on the command line.
void __fastcall TForm1::FormCreate(TObject *Sender)
{
for (int i=0;i<=ParamCount();i++)
{
if (LowerCase(ParamStr(i)) == "beep")
Beep(10000,1000);
else if (LowerCase(ParamStr(i)) == "exit")
Application->Terminate();
}
</quote>
--
See me at http://nigel.eke.name/
[ Note: return address anti-spammed, sorry: _at_ and _dot_ ]