用ShellExecuteEx加SEE_MASK_NOCLOSEPROCESS选项,可以方便地打开某个文档,并用WaitForSingleObject(x.hProcess)等待。但是当打开.doc文档时,SHELLEXECUTEINFO结构里的hProcess总是返回NULL。why? and how?
...全文
11410打赏收藏
高手看过来,当ShellExecuteEx遇到MS-WORD时。。。
用ShellExecuteEx加SEE_MASK_NOCLOSEPROCESS选项,可以方便地打开某个文档,并用WaitForSingleObject(x.hProcess)等待。但是当打开.doc文档时,SHELLEXECUTEINFO结构里的hProcess总是返回NULL。why? and how?
hProcess
Handle to the newly started application. This member is set on return and is always NULL unless fMask is set to SEE_MASK_NOCLOSEPROCESS. Even if fMask is set to SEE_MASK_NOCLOSEPROCESS, hProcess will be NULL if no process was launched. For example, if a document to be launched is a URL and an instance of Microsoft® Internet Explorer is already running, it will display the document. No new process is launched, and hProcess will be NULL.