Terminate a "Shelled" Program Using FnxBasic

In this category you can exchange your programming questions and solutions.
Post Reply
Darren
Posts: 63
Joined: Wed May 11, 2011 11:55 am

Terminate a "Shelled" Program Using FnxBasic

Post: # 1158Post Darren
Tue Nov 26, 2013 3:25 pm

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!!!!

fred
Posts: 54
Joined: Thu Apr 23, 2009 10:08 am

Terminate a "Shelled" Program Using FnxBasic

Post: # 1159Post fred
Mon Dec 30, 2013 1:52 pm

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

Post Reply