R
Reji
Hi All,
I have an MFC dialog based application, where I can browse for files
and open them. For opening files I get the file path and use
ShellExecute(...). But with ShellExecute(...), i lose control over the
process. So I am now using FindExecutable(...) and CreateProcess(...).
Now I am able to wait till the notepad document or similiar ones get
closed. (I am using WaitForSingleObject(processInfo.hProcess,
INFINITE)).
Now I have 2 issues :
1. The same code does not seem to work for word docs. The
WaitForSingleObject(processInfo.hProcess, INFINITE), returns
immediately. It does not wait for the word doc to get closed. But the
same code works for notepad files.
2. Even if I wait, how can I find out if the file has been modified or
not? Basically , I want my MFC application to be notified if the file
that it opened was modified and the changes were
saved by the user. I tried using
GetExitCodeProcess(processInfo.hProcess, &dwExitCode), but will I know
if the file has been modified or not using the dwExitCode?
Please help me with this.
Thanks in advance,
Reji
I have an MFC dialog based application, where I can browse for files
and open them. For opening files I get the file path and use
ShellExecute(...). But with ShellExecute(...), i lose control over the
process. So I am now using FindExecutable(...) and CreateProcess(...).
Now I am able to wait till the notepad document or similiar ones get
closed. (I am using WaitForSingleObject(processInfo.hProcess,
INFINITE)).
Now I have 2 issues :
1. The same code does not seem to work for word docs. The
WaitForSingleObject(processInfo.hProcess, INFINITE), returns
immediately. It does not wait for the word doc to get closed. But the
same code works for notepad files.
2. Even if I wait, how can I find out if the file has been modified or
not? Basically , I want my MFC application to be notified if the file
that it opened was modified and the changes were
saved by the user. I tried using
GetExitCodeProcess(processInfo.hProcess, &dwExitCode), but will I know
if the file has been modified or not using the dwExitCode?
Please help me with this.
Thanks in advance,
Reji