How close other applicatio

P

PawelR

Hello group,
Sorry my English is very littel.
I have question about close other application. For example in my application
I have button btCloseWord to close MSWord. How write source code in C#

if (btCloseButton.Click && Word.Open)
Word.Close
if (Word.Closed) MessageShow("Word is closed")

I want use this procedure for other application too.

Thanks PawelR
 
?

=?ISO-8859-2?Q?Marcin_Grz=EAbski?=

Hi Pawel,

Closing any application is not a common practise.
More i can say, it is very uncommon and unsafe thing.

You can try to do it by Process:

- Process.GetProcesses();
or
- Process.GetProcessesByName(...)

And then get wanted "Process" and:
- CloseMainWindow()
or
- Close()
or
- Kill()

I'd not test it, but it can work...

HTH
Marcin
 

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

Similar Threads

CrystalReport Time Diff 2
Close window after MessageBox 4
Windows Schedule 7
Send fax. 2
Refresh Page 1
Reading from dataBase 1
MD5 5
Binding date to textBox 3

Top