Solved

Close Application Requestion

Posted on 2011-02-16
4
332 Views
Last Modified: 2012-05-11
Hi,

I am developing an application that should be close for another one. I mean, I have my APP1.exe running (could exist only one APP1.exe or a several running at the same time) that must be closed by a command button in APP2.exe.

How can I do that considering the following constraint condition?
1) I do not want to use files
2) I do not want to use queue message
3) I do not want to use any networking?

I tought to use some SendMessage to all APP1.exe running, but how to do that? Any other idea will be welcome as well.

Thanks,

0
Comment
Question by:jr_barros_jr
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
gamarrojgq earned 300 total points
ID: 34906944
Hi,

You can do it like this

        Dim objProcess() As Process = System.Diagnostics.Process.GetProcessesByName("App1")

        For Each p As Process In objProcess
            p.Kill()
        Next
0
 
LVL 33

Assisted Solution

by:Todd Gerbert
Todd Gerbert earned 150 total points
ID: 34906976
Using Process.Kill() will forcefully close instances of App1 (which might be okay), or you can use Process.CloseMainWindow() - which has the same effect as if the user had closed the main window of each App1, which means App1 would have a chance to shutdown gracefully.

http://msdn.microsoft.com/en-us/library/system.diagnostics.process.closemainwindow.aspx
0
 
LVL 25

Assisted Solution

by:Luis Pérez
Luis Pérez earned 50 total points
ID: 34906994
Try this:

        Dim processList As Process() = Process.GetProcessesByName("App1")
        For Each uProcess As Process In processList
            uProcess.Kill()
        Next
0
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 34906996
Ooops... too late.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Replacing HTML tags in Textarea/Textbox 5 31
Code enhancement 5 13
Data Saving 5 40
.net Multiple Row Form Fields Data Entry 4 19
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now