用paramcount和paramstr,例
procedure TForm1.FormCreate(Sender: TObject);var
  i: Integer;
  for i := 1 to ParamCount do
  begin
    if LowerCase(ParamStr(i)) = 'beep' then
      Beep
    elseif LowerCase(ParamStr(i)) = 'exit' then
      Application.Terminate;
  end;
end;

解决方案 »

  1.   

    在dpr文件中修改。
    if ParamStr(1) = '/abc' then
    begin
      Application.CreateForm(TForm2, Form2);
      Application.CreateForm(TForm1, Form1);
    end
    else
    begin
      Application.CreateForm(TForm1, Form1);
      Application.CreateForm(TForm2, Form2);
    end;
      

  2.   

    to: netlib(河外孤星) 
    TForm1是哪一个窗口,是主程式窗口吗?Application.Terminate;是什么意思?起会长做用?
      

  3.   

    给你一个例子:
    c\> project1.exe  beep
     时响一下并显示'beep'program Project1;
     {$apptype console}
    uses
      Forms,
      sysutils;{$R *.res}
      var
       i:integer;
    begin
      begin
       for i:=0 to paramcount do
           if lowercase(paramstr(i))='beep' then
              writeln('beep');
              beep;
      end;
    end.
      

  4.   

    或者这样:
    procedure TForm1.FormCreate(Sender: TObject);
    var
      pcount,i:integer;
    begin
    pcount:=paramcount;  //获得参数的个数
    if pcount>0 then
      caption:='';
     for i:=1 to pcount do
       begin
         caption:=caption+'第'+inttostr(i)+'个参数是'+paramstr(i)+'  ';
       end;
    end;
      

  5.   

    form1当然是主窗口了Application.Terminate;和你的程序没关系,
    你只要知道用paramcount得到参数个数,
    用paramstr取参数值就行了。
      

  6.   

    Application.Terminate; 是程序中止. 也就是关闭程序了