473,386 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Is application running?

Hi again, hopefully the last question for the damned application!

I have one application that needs to load another, this may happen everytime
the first app is started, or it may happen randomly.

If the second app is not open my first app needs to open it. If the second
app is running I can simply leave things alone.

I can find loads of examples for 'PrevInstance' but I can't find anything
for checking the Task Manager list to see if the second app is already
there.

Any deas?

Cheers,
Tull.
Oct 31 '06 #1
3 1351
Try the "Process.GetProcesses()" or "Process.GetProcessesByName()" methods.

-----
Tim Patrick
Start-to-Finish Visual Basic 2005
Hi again, hopefully the last question for the damned application!

I have one application that needs to load another, this may happen
everytime the first app is started, or it may happen randomly.

If the second app is not open my first app needs to open it. If the
second app is running I can simply leave things alone.

I can find loads of examples for 'PrevInstance' but I can't find
anything for checking the Task Manager list to see if the second app
is already there.

Any deas?

Cheers,
Tull.

Oct 31 '06 #2
To give the same example...this will search to see if notepad is running and
kill it.
But instead of the kill you can do ur code,

This should get you started.

'Where textbox1.text = "NOTEPAD" not NOTEPAD.EXE
Dim myProcesses() As Process
Dim myProcess As Process

myProcesses = Process.GetProcessesByName(Trim(TextBox1.Text))
For Each myProcess In myProcesses
myProcess.Kill()
Next
Miro


"Tim Patrick" <in*****@invalid.com.invalidwrote in message
news:e3*************************@newsgroups.comcas t.net...
Try the "Process.GetProcesses()" or "Process.GetProcessesByName()"
methods.

-----
Tim Patrick
Start-to-Finish Visual Basic 2005
>Hi again, hopefully the last question for the damned application!

I have one application that needs to load another, this may happen
everytime the first app is started, or it may happen randomly.

If the second app is not open my first app needs to open it. If the
second app is running I can simply leave things alone.

I can find loads of examples for 'PrevInstance' but I can't find
anything for checking the Task Manager list to see if the second app
is already there.

Any deas?

Cheers,
Tull.


Oct 31 '06 #3
Thanks to all!

Cheers,
Tull.

"TClancey" <tu**@idcodeware.co.ukwrote in message
news:cO********************@bt.com...
Hi again, hopefully the last question for the damned application!

I have one application that needs to load another, this may happen
everytime the first app is started, or it may happen randomly.

If the second app is not open my first app needs to open it. If the
second app is running I can simply leave things alone.

I can find loads of examples for 'PrevInstance' but I can't find anything
for checking the Task Manager list to see if the second app is already
there.

Any deas?

Cheers,
Tull.

Nov 2 '06 #4

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

Similar topics

6
by: Dmitry Karneyev | last post by:
Hi! I guess this question have been asked a lot of times, but please be tolerant and if you have any ideas share it. The question is: how to make availibale only one instance of application and...
4
by: Chuck | last post by:
Hello everybody, I need to abort execution during start up, while the constructor called by Application.Run is executing. If the database fails to connect during my application's startup I...
21
by: Chris | last post by:
I'm trying to get an existing VS.NET project up on my Win2003 server and I get the following error (on the actual website page): "It is an error to use a section registered as...
8
by: mike2036 | last post by:
I have an application (that has unmanaged code) and when I launch it without 'FullTrust' permissions (LocalIntranet_Zone), it crashes. When I set 'FullTrust' permissions, it launches fine. Is...
8
by: Bryan | last post by:
Does anyone have an example of an application that can connect to a running process and capture Trace.WriteLine calls like in SQL Server Profiler? I know that we can inherit from a TraceListener...
1
by: whitehorse | last post by:
When the warehousecontroller service is invoked, the following error message is sent to the application log: Event Type: Error Event Source: TFS Warehouse Event Category: None Event ID: 3000...
4
by: casper | last post by:
Hi, I created an asp.net 2.0 website with VWD and made it an application in IIS. It was created on a ntfs disc (my documents...). The directory permissions are set on 'anonymous allowed' using...
7
by: Aryan | last post by:
Hi Everybody, I am facing "Server Application Unavailable" problem with .NET Framework 2.0 Earlier Framework was working fine, but one fine day it stopped working for particular application....
15
by: =?Utf-8?B?TVNU?= | last post by:
To demonstrate my problem, I have a very simple VB Windows application. It has a text box that is used to display a counter, a button to reset the counter, and a timer that increments the counter...
4
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.