PC Review


Reply
Thread Tools Rate Thread

How to detect closing a file opened by a Process?

 
 
Henk van Winkoop
Guest
Posts: n/a
 
      25th Apr 2007
Hello,

I would like to open a 'Help.chm' file on a button click.
I got the advice to use a Process object.

//create a process
Process prc = new Process;
//add filename to the process
prc.StartInfo.FileName="Help.chm";
//open file
prc.Start();

this all works fine.

If I click the button twice I get an exception error that the file is
allready open.
Can I somehow set the openened file to modal?
Or can my application somehow been signalled when the file is closed
by the user?

I tried a Process control on my form but it's 'Exited' event is not
executed on file closing.

All tips welcome,

regards,

Henk


 
Reply With Quote
 
 
 
 
Serge Baltic
Guest
Posts: n/a
 
      25th Apr 2007
Hello,

> I would like to open a 'Help.chm' file on a button click.


You could use the HtmlHelp API to open the window with your CHM file. It
will reuse the existing window if you invoke it the second time.

http://msdn.microsoft.com/library/de...splaytopic.asp

(H) Serge


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to detect if a file is accessed (Opened) Martin Arvidsson, Visual Systems AB Microsoft C# .NET 10 24th Jan 2007 02:41 PM
I OPENED A FILE WITH WORD 2000, IT OPENED WITH BOXES & SYMBELS =?Utf-8?B?UC4gSi4gTUFSQ0VMTEU=?= Microsoft Word New Users 2 5th Jun 2006 07:56 AM
Closing event in a MID Child form I don't know if the child form is closing or the main form is closing **Developer** Microsoft C# .NET 1 19th Oct 2005 04:51 PM
stop excel file opened as read only if already opened by another u =?Utf-8?B?Ym9ibQ==?= Microsoft Excel Programming 3 5th Aug 2005 04:11 PM
newbie: Detect if a file is already opened =?Utf-8?B?U2FtIEpvaG5zb24=?= Microsoft Dot NET 3 25th Feb 2004 08:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:36 AM.