Page 1 of 1

Terminate a "Shelled" Program Using FnxBasic

Posted: Tue Nov 26, 2013 3:25 pm
by Darren
Can anybody help???

I am using "Shell" to run an external program (example Only!!!) thus:

Dim Pid As Integer

Pid = Shell("notepad.exe")

`Showmessage(Pid)

Is it possible to terminate the "shelled program" using FnxBasic

Eg Using the value "Pid"????

Many thanks in advance!!!!

Terminate a "Shelled" Program Using FnxBasic

Posted: Mon Dec 30, 2013 1:52 pm
by fred
Never used it but I think there are ( at least ) 2 ways.

1: use Windows API like shown here: http://stackoverflow.com/questions/2443738/c-terminateprocess-function

2: use an external tool to kill the process(id) like: Shell/Run taskkill ( xp professional ) or tskill (xp home ) or pskill