梁家辉之《江湖告急》:用shellexecute传递多个参数启动程序,大家帮忙看看我这句代码写得对不对?(100分)

  • 主题发起人 主题发起人 xdzhan
  • 开始时间 开始时间
X

xdzhan

Unregistered / Unconfirmed
GUEST, unregistred user!
我在其他程序程中调用我写的程序,将原来的文件名和转换后的文件名作为参数传递过去,完成转换动作,如下:<br>shellexecute(0,nil,pchar('MyApp'),PChar('/Conversion空格"' + 'C:/Documents and Settings/Administrator/My Documents/xxx.BMP' + '空格"'+'C:/Documents and Settings/Administrator/My Documents/My Pictures/xxx.JPG'+'"'),nil,SW_Show);<br>这里我传递了三个参数,第一个参数是转换命令“Conversion”,第二个参数是要转换的文件名称:'C:/Documents and Settings/Administrator/My Documents/xxx.BMP<br>第三个参数是转换后的文件名称:'C:/Documents and Settings/Administrator/My Documents/My Pictures/xxx.JPG'<br>却总是无法成功调用[:(]<br>
 
好像缺少一个双引号呀。<br>shellexecute(0,nil,pchar('MyApp'),PChar('/Conversion空格"' +<br>'C:/Documents and Settings/Administrator/My Documents/xxx.BMP' + '"空格"'+<br>'C:/Documents and Settings/Administrator/My Documents/My Pictures/xxx.JPG'+'"'),nil,SW_Show);<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>&nbsp; ShellExecute(Handle, 'open', 'E:/Temp/Project1.Exe', '/Help "a &nbsp;v" &nbsp;"c d" ', 'E:/Temp', sw_NorMal);<br>end;<br>显示的是:<br>/Help<br>a v<br>c d<br>三个参数
 
to yzhshi:<br>谢谢您了[:)]
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部