How can I test, if other application is running and how can I kill this ?
For example I want run other exe program notepad.exe, and first I want test, if it is running. If yes, nothing happens, if no, notepad.exe run
And then I want kill this program from Xbase++ application.
Data is no problem, because external application is in view mode, and no data change in it.
I examine some example from here, xbwin,but I do not know,how compile, some error
I tried ot4xb, download ot4xb.lib and ot4xb.ch, link but error :
unresolved external symbol _CALLBACK_WILDFINDWINDOW_ENUMPROC,
I do not know, what is it.
Test and kill external application
Re: Test and kill external application
RunShell( '/IM Notepad.exe', 'TaskKill.Exe' )
The eXpress train is coming - and it has more cars.
Re: Test and kill external application
How can one check if exe is running
Thanks.
Joe
Thanks.
Joe
Re: Test and kill external application
ok, I found taskkill, it runs ok,
also for view if exe is running is "command" tasklist for ezxample :
tasklist /fi "imagename eq notepad.exe"
this generate listing where is info, if this process is running. I want use this report (generate to file >file.txt ) and read this file
but better will be some command : isrunning("notepad.exe") .T. or .F.
also for view if exe is running is "command" tasklist for ezxample :
tasklist /fi "imagename eq notepad.exe"
this generate listing where is info, if this process is running. I want use this report (generate to file >file.txt ) and read this file
but better will be some command : isrunning("notepad.exe") .T. or .F.

Re: Test and kill external application
Hi, Victorio.
Look at this message from the "German Xbase Forum". It shows you how to get an array with all running tasks in it:
http://www.xbaseforum.de/viewtopic.php? ... ist#p92485
Look at this message from the "German Xbase Forum". It shows you how to get an array with all running tasks in it:
http://www.xbaseforum.de/viewtopic.php? ... ist#p92485
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Test and kill external application
if you "run" a external Application with RunShell() you have "no Control" about it ... it might "run" or "hang" ...Victorio wrote:How can I test, if other application is running and how can I kill this ?
you need a Handle to check "IsRunning" or to "kill" a Task.
Rogers Solution will IHMO "kill all" Notepad.EXE Tasks when have more than 1 Instance.
try Pablos TRunProcess Class to "run" a external Application
greetings by OHR
Jimmy
Jimmy