473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to get Notifications when a word doc is modified and closed

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

Mar 24 '06 #1
6 2223
Reji wrote:
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)).

You will have better luck on a windows programming group, this isn't a
C++ issue.
--
Ian Collins.
Mar 24 '06 #2
Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
in a noraml C++ program? Forget the MFC application. How can I do it in
a C++ application?

Thanks in advance,
Reji

Mar 24 '06 #3
Reji wrote:
Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
in a noraml C++ program? Forget the MFC application. How can I do it in
a C++ application?

I believe so, but they are windows functions, not part of standard C++.

--
Ian Collins.
Mar 24 '06 #4

Ian Collins 写道:
Reji wrote:
Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
in a noraml C++ program? Forget the MFC application. How can I do it in
a C++ application?

I believe so, but they are windows functions, not part of standard C++.

--
Ian Collins.


If u can help, then do it anyway

Mar 24 '06 #5
jimmy wrote:
Ian Collins 写道:

Reji wrote:
Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
in a noraml C++ program? Forget the MFC application. How can I do it in
a C++ application?


I believe so, but they are windows functions, not part of standard C++.

--
Ian Collins.

If u can help, then do it anyway

Who's u?

This is a C++ Language group, not a windows programming one. There are
plenty of those.

--
Ian Collins.
Mar 24 '06 #6
jimmy wrote:
Ian Collins 写道:
Reji wrote:
Thanks Ian, But can i not use CreateProcess() and WaitForSingleObject
in a noraml C++ program? Forget the MFC application. How can I do it in
a C++ application?

I believe so, but they are windows functions, not part of standard C++.

--
Ian Collins.


If u can help, then do it anyway


He already did. He suggested "a windows programming group" since "this
isn't a C++ issue".

C++ does not have any native thread support, that support comes from an
OS, and is thus OS specific.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Mar 24 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dipak Patel | last post by:
Platform: Win2000 SP3, SQL 7.00 - 7.00.1063 I have a SQL-authenticated user with the following permissions: "Process Administrators" server role "db_owner" and "TargetServersRole" for msdb...
0
by: kc | last post by:
I'm using a Repeater to display a series of lines, each containing a date and two images, one for Word and the other for PDF. Both images display their respective documents, in new windows, when...
3
by: Andy Davis | last post by:
How do i or can I open a word document directly from Access? I would like to be able for the user to click a button on my form to open a word document and then also run a macro in Word. Thanks...
1
by: kieran | last post by:
Hi, I have created a database webform that tracks problems. When problems are created, the form sends out an email to the person who will solve the problem. However now i have been told to...
2
by: CM | last post by:
Hi, Could anyone please help me? I am completing my Master's Degree and need to reproduce a Webpage in Word. Aspects of the page are lost and some of the text goes. I would really appreciate it....
0
southoz
by: southoz | last post by:
Good ay all , I'm fairly new to access(a little over 5 weeks now). Since I'v started I have picked up a lot of useful information from forums such as this and in doing so will share that information...
11
by: Huayang Xia | last post by:
What will the following piece of code print? (10 or 15) def testClosure(maxIndex) : def closureTest(): return maxIndex maxIndex += 5 return closureTest()
0
by: venkat | last post by:
Hi Everybody, I am Using DSO Framer To host Word Document in my windows application.at run time i entered some data in word document .How could i know the modified status of the word document....
5
by: njuneardave | last post by:
I have a full-screen C# app, but windows notifications (the little balloons on the bottom right-hand of the screen) and outlook reminders will pop on top of my app. i want to prevent them from...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.