How to detect closing a file opened by a Process?

H

Henk van Winkoop

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top