Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to determine if anothather app is running

Status
Not open for further replies.

fhutt

Programmer
Jul 7, 2006
79
AU
How do I dtermine, in a TCL/TK application if there is another, unrelated TCL/TK application open?

I need to be sure that there is no other app running, otherwise I need to shut down that first application.
If there is a way to find out, then I need to find out how shut that app down using the newly launched TCL/TK application.
Can anyone please help?
Thanks
Fhutt
 
You have to go through the OS (using exec). So, in UNIX, for example, it would be
Code:
set rlst [exec "ps -ef| grep tclsh"]
Then rlst will be a list of running processes of tclsh. I'm not sure how to do it in Windows.

_________________
Bob Rashkin
 
Thank you for the ideas.
I found an easyer way to both find out if my other application is running and also to shut it down if it is running.

package require dde 1.2
set topic tcluse1
if {[dde services TclEval {} ] == "\{TclEval $topic\}"} {
dde execute -async TclEval $topic exit
}
dde servername $topic

If the {[dde services TclEval {} ] is equal to {TclEval $topic} then another of my applications must be active. In this case, execute the dde following to exit that application. Then the last dde servername $topic assingns the $topic to the current application so if it is launced again, then this application will be found and shut down.
Fhutt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top