delphi中使用shellexecute ( 积分: 100 )

  • 主题发起人 主题发起人 formiss
  • 开始时间 开始时间
F

formiss

Unregistered / Unconfirmed
GUEST, unregistred user!
调用exe应用程序,返回值5.<br>shellExecute(0,nil,PChar('F:/Client/App.exe',PChar(TransParams),nil,SW_SHOWNORMAL);<br>返回值为5,为什么?<br>如果,TransParams小一些的话就返回42.可以执行App.exe.<br>搞了两天了,真是晕死了.
 
用dos-command执行一下app.exe&nbsp;TransParams,看看是否有问题。
 
参数太长了啊,不好弄.<br>有没有更好的方式?
 
shellExecute(handle,nil,PChar('F:/Client/App.exe'),PChar(TransParams),nil,SW_SHOWNORMAL);试试!我试过调用一个VB做的Exe,传了9个参数过去没问题!
 
试试<br>shellExecute(0,nil,PChar('F:/Client/App.exe&nbsp;'&nbsp;+&nbsp;TransParams),nil,nil,SW_SHOWNORMAL);
 
Returns&nbsp;a&nbsp;value&nbsp;greater&nbsp;than&nbsp;32&nbsp;if&nbsp;successful,&nbsp;or&nbsp;an&nbsp;error&nbsp;value&nbsp;that&nbsp;is&nbsp;less&nbsp;than&nbsp;or&nbsp;equal&nbsp;to&nbsp;32&nbsp;otherwise.&nbsp;The&nbsp;following&nbsp;table&nbsp;lists&nbsp;the&nbsp;error&nbsp;values.&nbsp;The&nbsp;return&nbsp;value&nbsp;is&nbsp;cast&nbsp;as&nbsp;an&nbsp;HINSTANCE&nbsp;for&nbsp;backward&nbsp;compatibility&nbsp;with&nbsp;16-bit&nbsp;Windows&nbsp;applications.&nbsp;It&nbsp;is&nbsp;not&nbsp;a&nbsp;true&nbsp;HINSTANCE,&nbsp;however.&nbsp;The&nbsp;only&nbsp;thing&nbsp;that&nbsp;can&nbsp;be&nbsp;done&nbsp;with&nbsp;the&nbsp;returned&nbsp;HINSTANCE&nbsp;is&nbsp;to&nbsp;cast&nbsp;it&nbsp;to&nbsp;an&nbsp;int&nbsp;and&nbsp;compare&nbsp;it&nbsp;with&nbsp;the&nbsp;value&nbsp;32&nbsp;or&nbsp;one&nbsp;of&nbsp;the&nbsp;error&nbsp;codes&nbsp;below
 
后退
顶部