+ -
当前位置:首页 → 问答吧 → ShellExecute

ShellExecute

时间:2011-12-09

来源:互联网

我在C++Builder中用 ShellExecute(0, "Open", ExeName.c_str(),"abc",NULL,SW_SHOW); 然后在Delphi中用
end;

procedure TMainForm.FormCreate(Sender: TObject);
var
  hsList: THashedStringList;
  I: Integer;
begin
  hsList := THashedStringList.Create;
  try
  for I := 1 to ParamCount - 1 do
  begin
  hsList.Add(ParamStr(i));
  end;
  ShowMessage(hsList.Text);
  finally
  hsList.Free;
  end;
end;
怎么接收不到参数abc,还有个问题,就是我要发送多个参数时是什么格式的

作者: liuhengwinner   发布时间: 2011-12-09

ExeName最后加个空格试试
===================
如果没有特殊需要, 只是要在程序中启动另一个程序, 用 
ShellExecute(NULL, NULL, "c:\\winnt\\notepad.exe ", "d:\\11.txt ", NULL, SW_SHOWNORMAL); 
更方便了 

或者更简单的, 用winexec 
WinExec( "c:\\winnt\\notepad.exe d:\\11.txt ", SW_SHOWNORMAL); 

作者: ksrsoft   发布时间: 2011-12-09

热门下载

更多