问题描述
大家好..
以编程方式试图在Microsoft Office 2007上运行.代码如下所示:
Hello Everyone..
Programatically am trying to run on Microsoft office 2007. The code looks like this:
char exe_arr[100]="E:\\setup.exe";
HINSTANCE hInst = ShellExecute(0,"open",exe_arr,"",0,SW_SHOW);
无论如何,执行此命令后,代码将打开office setup.exe ...
后者确定exe的状态,即,如果exe正在运行,则状态为1,如果exe退出,则状态为0.
要确定exe状态,代码如下所示:
Anyhow after executing this, The code opens the office setup.exe...
And latter Am determining the status of the exe i.e., If exe is running the status is 1, And if exe is quit the status is 0.
To determine the exe status, the code looks like this:
int isRunning;
isRunning=FIND_PROC_BY_NAME("setup.exe");
当我执行此代码时,即使setup.exe正在运行,FIND_PROC_BY_NAME
也会返回0状态.它应该返回1状态吗?
但是此代码对于其他exe应用程序也能正常工作..
谁能说出为什么office setup.exe返回0状态?
在此先谢谢.. !!!!
When i execute this code, FIND_PROC_BY_NAME
returns 0 status, eventhough setup.exe is running..& it should return 1 status right ?
But this code works fine for other exe applications..
Can anyone tell, Why it is returning 0 status for office setup.exe ??
Thanks in advance..!!
推荐答案
这篇关于确定进程是否正在运行.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!