|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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. 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. 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. > > 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. >
Why does activex control run 3x+ faster in vb5 than .net?
Format string in DataGrid TCP Transfer issues Treeview doubleclick help From VB Newbie: The editor is driving me nuts. Multiple TcpListeners on the same IP address To create an instance of class in VB2005 Help with Vb.net 2002 Update VB6 to VB.NET 2.0 Email Send Windows Service not starting automatically |
|||||||||||||||||||||||