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 01:41 PM
"The file cannont be opened because your virus scanner has detect. =?Utf-8?B?S0NvdHRlZW4=?= Microsoft Excel Crashes 1 20th Nov 2006 10:25 PM
Closing opened file handles Neville Lang Microsoft Dot NET Compact Framework 2 27th May 2005 12:51 AM
newbie: Detect if a file is already opened =?Utf-8?B?U2FtIEpvaG5zb24=?= Microsoft Dot NET 3 25th Feb 2004 07:40 PM
when second file is opened the first auto closing... =?Utf-8?B?SmF6eg==?= Microsoft Word Document Management 0 21st Jan 2004 02:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:40 AM.