Click here to Skip to main content
15,891,597 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all

i wrote a code that have a button to open power point file by openfiledialog.
if the user opened a file by that button, and then closed this file,i need the code that realize whenever the user closed that file.
Posted
Comments
Nueman 30-Dec-11 14:43pm    
It is rude to double post, particularly when someone has answered your question. See your first post.

If you create the presentation using interop, you can use EApplication_Event.PresentationClose[^] event to get a notification before the presentation is closed.
 
Share this answer
 
When you start the process, handle the Process.Exited event - as long as you enable the Process.EnableRaisingEvents you will get an event when the external app ends:
C#
    Process p = new Process();
    ProcessStartInfo psi = new ProcessStartInfo(@"D:\Temp\myLargeTextFile.txt");
    p.EnableRaisingEvents = true;
    p.StartInfo = psi;
    p.Exited += new EventHandler(process_Exited);
    p.Start();
    ...

void process_Exited(object sender, EventArgs e)
    {
    MessageBox.Show("It closed");
    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900