473,624 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 WaitForSingleOb ject(processInf o.hProcess,
INFINITE)).
Now I have 2 issues :
1. The same code does not seem to work for word docs. The
WaitForSingleOb ject(processInf o.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
GetExitCodeProc ess(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 2240
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 WaitForSingleOb ject(processInf o.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 WaitForSingleOb ject
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 WaitForSingleOb ject
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 WaitForSingleOb ject
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 WaitForSingleOb ject
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 WaitForSingleOb ject
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
578
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 database "db_owner" for master database. The problem is that when this user opens up any job (i.e. owned by any user) in the SQL Server Agent, and goes to the Notifications tab, the first three alerts (Email, Page and Net send) are greyed out, i.e.
0
1377
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 clicked. When the window containing the Word document is closed, a login prompt (to the base web server) is raised (maybe Word is trying to update the document on the server?). Any idea how I can prevent this? The symptoms were the same when the...
3
5807
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 in advance
1
1228
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 make the app send out notifications if the open problems are not closed after a certain period i.e. if an open problem is not closed after 4 days, send out an email again.
2
579
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. The link to the document is http://www.surveymonkey.com/s.asp?u=689952259313 I have spent 15 hours trying to sort this but to no avail.
0
8656
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 with others. I have seen many request for information on mail merging an how to send data to word documents this is something I have put together with the answers given by others and I hope this will help a few newbies , I know there are easier ways...
11
3017
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
1173
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. in the below code axFramerControl1 is DSOFramer Object and i converted it to Word Document.But I couldnt find any property to know Modified status.
5
3499
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 doing so. does anyone know how? thanks so much
0
8236
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8173
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8679
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8621
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8475
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7159
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2606
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.