Home All Groups Group Topic Archive Search About

Is application running?

Author
31 Oct 2006 5:56 PM
TClancey
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.

Author
31 Oct 2006 6:24 PM
Tim Patrick
Try the "Process.GetProcesses()" or "Process.GetProcessesByName()" methods.

-----
Tim Patrick
Start-to-Finish Visual Basic 2005

Show quoteHide quote
> 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.
Author
31 Oct 2006 6:49 PM
Miro
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




Show quoteHide quote
"Tim Patrick" <inva***@invalid.com.invalid> wrote in message
news:e3b4697615bf8c8caedd794567c@newsgroups.comcast.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.
>
>
Author
2 Nov 2006 10:26 AM
TClancey
Thanks to all!

Cheers,
Tull.

Show quoteHide quote
"TClancey" <t***@idcodeware.co.uk> wrote in message
news:cO2dnVxR7-SyE9rYRVnyiQ@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.
>