ShellExecute 与 CreateProcess 调用外部程序
来源:互联网 发布:Linux 内核的dm-verity 编辑:程序博客网 时间:2024/04/28 16:08
1、ShellExecute(handle,"open","notepad.exe","c:/MyLog.log","",SW_SHOW );
2、ShellExecute(handle,"open","wordpad.exe","c:/MyLog.log","",SW_SHOW );
3、ShellExecute(handle,"open","c:/My.exe","c:/MyLog.log","",SW_SHOW );
在win2000 server中
执行命令(1)时,通过
执行命令(2)时,出现错误提示“找不到文件”XP下可以通过
执行命令(3)时,不能通过,也没有什么 提示
又特别地
第3句改为 ShellExecute(handle,"open","c:/My.exe","c:/My Log.log","",SW_SHOW );
“My Love.mp3”分开有空格怎么办???
来自:bluebridge, 时间:2003-4-26 2:48:00, ID:1803811
其实不用exe文件参数,windows会自动找到log文件关联的执行程序的。去掉试试。
////////////////////////////////////////////////-----------------------
/* Compile options needed: none*/ #include <windows.h>#include <stdio.h>void main(void){ PROCESS_INFORMATION pInfo; STARTUPINFO sInfo; DWORD exitCode; sInfo.cb = sizeof(STARTUPINFO); sInfo.lpReserved = NULL; sInfo.lpReserved2 = NULL; sInfo.cbReserved2 = 0; sInfo.lpDesktop = NULL; sInfo.lpTitle = NULL; sInfo.dwFlags = 0; sInfo.dwX = 0; sInfo.dwY = 0; sInfo.dwFillAttribute = 0; sInfo.wShowWindow = SW_SHOW; if (!CreateProcess(NULL, "command.com /c dir c://*.bat", NULL, NULL, FALSE, 0, NULL, NULL, &sInfo, &pInfo)) { printf("ERROR: Cannot launch child process/n"); exit(1); } // Give the process time to execute and finish WaitForSingleObject(pInfo.hProcess, 5000L); if (GetExitCodeProcess(pInfo.hProcess, &exitCode)) { switch(exitCode) { case STILL_ACTIVE: printf("Process is still active/n"); break; default: printf("Exit code = %d/n", exitCode); break; } } else { printf("GetExitCodeProcess() failed/n"); }}
- ShellExecute 与 CreateProcess 调用外部程序
- shellexecute调用外部程序,程序执行出问题
- VC中调用外部程序方法: CreateProcess
- MFC 打开外部文件 WinExec,ShellExecute ,CreateProcess
- MFC 打开外部文件 WinExec,ShellExecute ,CreateProcess
- MFC 打开外部文件 WinExec,ShellExecute ,CreateProcess
- c++本程序如何调用执行另一个程序WinExce,ShellExecute,CreateProcess
- vc中ShellExecute的使用(调用外部程序)
- C/C++使用WinAPI CreateProcess函数调用外部程序
- WinExec,ShellExecute ,CreateProcess 调用其他进程,即开启其他exe程序
- WinExec,ShellExecute ,CreateProcess 调用其他进程,即开启其他exe程序
- CreateProcess ShellExecute
- 启动、关闭外部进程ShellExecute() 、CreateProcess()、TerminateProcess()、OpenProcess()==
- c++中调用其他应用程序的方法winexec shellexecute createprocess
- shellexecute 和 createprocess,运行一个程序直到其结束
- C#启动一个外部程序(2)-ShellExecute
- WinAPI: ShellExecute - 打开外部程序或文件
- WinAPI: ShellExecute - 打开外部程序或文件
- 二OO六年十大商业好书
- MANUFACTURING PLANNING AND EXECUTION
- SQL SERVER实用经验技巧集
- sqEditor HTML 编辑器 for .net v1.0 By shawl.qiu
- Student Visa Application Procedures
- ShellExecute 与 CreateProcess 调用外部程序
- 句柄
- 全局命名空间的划分
- 程序规范
- komm, süsser tod
- 正在经历的痛苦
- 战士分发子弹例题
- 搞清楚top、postop、scrolltop、scrollHeight、offsetHeight 的用法
- 成员函数 非成员函数和友元函数