473,790 Members | 2,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

close application after CreateProcess

I need to launch application-2 from application-1 and close application-1.
My code is

CreateProcess ("app2",0,0,0,0 ,0,0,0,0,0);
Application.Exi t();

but application-1 is not terminate since I see its name in the "Start" line.
Any ideas? Thank you.
Nov 16 '05 #1
3 2187
Dan

Is your application-1 multithreaded?
If it is Application.Exi t() will only close the main thread, but the other's
will continue to run, keeping the process open...

"carmen" <ce*********@ya hoo.es> wrote in message
news:O%******** *******@TK2MSFT NGP11.phx.gbl.. .
I need to launch application-2 from application-1 and close application-1.
My code is

CreateProcess ("app2",0,0,0,0 ,0,0,0,0,0);
Application.Exi t();

but application-1 is not terminate since I see its name in the "Start"
line.
Any ideas? Thank you.

Nov 16 '05 #2
carmen wrote:
I need to launch application-2 from application-1 and close application-1.
My code is

CreateProcess ("app2",0,0,0,0 ,0,0,0,0,0);
Application.Exi t();

but application-1 is not terminate since I see its name in the "Start" line.
Any ideas? Thank you.


Try this:

Environment.Exi t(0)

bye
Rob
Nov 16 '05 #3
There was the serial port open !
Thank you.

"Robert Jordan" <ro*****@gmx.ne t> escribió en el mensaje
news:ch******** *****@news.t-online.com...
carmen wrote:
I need to launch application-2 from application-1 and close application-1. My code is

CreateProcess ("app2",0,0,0,0 ,0,0,0,0,0);
Application.Exi t();

but application-1 is not terminate since I see its name in the "Start" line. Any ideas? Thank you.


Try this:

Environment.Exi t(0)

bye
Rob

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2620
by: Mr. B | last post by:
VB.net 2003 (standard) In my application, within FORM1_LOAD, I check for various things (ie valide user names, files, etc.). What I want to do is upon an event such as "No Valide User Name Found" to pop up a warning message about the event and then close the application. I can do everything I want with the exception of a clean shut down during the Form1_Load.
0
464
by: PawelR | last post by:
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.
1
1173
by: Ian | last post by:
I have just begun to to learn how to write macros in VC++. For learning purposes, I would like to implement a macro that accesses all files in a 'test' project and makes a series of changes to these files. I am able to identify each file in my project and then open the file. But I have yet to figure out how to close the file. Could someone kindly tell me how to close a file? The following BASIC code illustrates my first efforts: ...
5
1697
by: Nicola Farina | last post by:
Hi all, I've a window form application with 3 forms. I want to catch the security exception when users run this application from a network share, thus I've made this code (I've notice that excpetion has been throw by initializecomponent()): Try InitializeComponent() Catch ex As Security.SecurityException
1
1155
by: GeorgeK | last post by:
Hello guys, I'm writing a little application and I need to copy something into the clipboard and then close the application. When I terminate the app with END or Me.Close the clipboard gets cleared and I get nothing out of it. I'm sorry if this is too easy for you guys but I'm not a programmer. I'm a system administrator trying to work around a problem in an application with a little VB app.
3
4159
by: rdemyan via AccessMonster.com | last post by:
Sometimes users (including myself) accidentally click on the application close icon in the application menu bar when they meant to just click on the 'X' for the form. Of course the app closes and this is very annoying. So, I added a messagebox to my hidden StartAppForm in the Unload event. Now when the application closes the user is presented with a message so they can abort closing in case they don't really want to close. This has been...
8
3334
by: Rodrigo Juarez | last post by:
Hi I'm using Visual Studio 2005 with visual basic, developing winforms applications I'm adding try catch blocks for error handling and I want to close the application when I got an error. Closing the form is not enough because there is a lot of forms open TIA Rodrigo Juarez
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10419
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10201
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6770
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.