求ShellExecute函数解释(200分)

  • 主题发起人 主题发起人 qia
  • 开始时间 开始时间
Q

qia

Unregistered / Unconfirmed
GUEST, unregistred user!
求ShellExecute函数解释
 
ShellExecute 查找与指定文件关联在一起的程序的文件名 <br>返回值 <br>Long,非零表示成功,零表示失败。 <br>参数 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 类型及说明 <br>hwnd Long, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;指定一个窗口的句柄,有时候,windows程序有必要<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;在创 建自己的主窗口前显示一个消息框 <br>lpOperation String, &nbsp; 指定字串“open”来打开lpFlie文档,或指定<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “Print”来打印它 <br>lpFile String, &nbsp; &nbsp; &nbsp; &nbsp; 想用关联程序打印或打开一个程序名或文件名 <br>lpParameters String, &nbsp; 如lpszFlie是可执行文件,则这个字串包含传递给<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 执行程序的参数 <br>lpDirectory String, &nbsp; &nbsp; 想使用的完整路径 <br>nShowCmd Long, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;定义了如何显示启动程序的常数值。 <br><br>
 
ShellExecute(<br>&nbsp; &nbsp; &nbsp; hwmd, &nbsp; &nbsp; &nbsp;//父窗口句柄<br>&nbsp; &nbsp; &nbsp; LPCSTR lpszOp;//要执行操作窜的地址 可以为open ,print默认为open<br>&nbsp; &nbsp; &nbsp; LPCSTR lpszFile;//文件名窜的地址 <br>&nbsp; &nbsp; &nbsp; LPCSTR lpszParams;//执行文件串的地址<br>&nbsp; &nbsp; &nbsp; LPCSTR lpszDir;//默认目录串的地址<br>&nbsp; &nbsp; &nbsp; int fsShowCmd;//打开时文件是否显示<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );
 
接受答案了.
 
我无话可说!
 
以调用notepad为例:<br>ShellExecute(this-&gt;Handle, //父窗口句柄<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"open","notepad.exe", //可执行程序<br>&nbsp; &nbsp; sFileName, &nbsp; &nbsp; &nbsp;//可执行程序的参数,这里是要打开的文件名<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NULL,SW_SHOWNORMAL); &nbsp;//打开窗口的方式
 
后退
顶部