Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 Tags
Subject: RE: Kill EXE API
Thread ID: 416387 Message ID: 416468 # Views: 35 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Win32API programming
Date: Tuesday, December 30, 2014 1:30:04 AM         
   


> Morning everyone,
>
> Thanks to all who replied thus far.
>
> On the Kill an application since I have to get something to work
> other than scripting methods I could not find anywhere after looking
> yesterday and this morning on any API calls that worked to obtain
> - Processor ID
> - Solid way to KILL a running exe "one worked, but one once and on occasion error out."
>
> So for the Kill I went with this routine and used what Chen had suggested . . .
>
* --- KillEXE.prg
> PARAMETERS lcAppl
> * --- Syntax: = KillEXE("NotePad.EXE")
> * --- Windows ShellExecute() API.  To lauch a runable EXE's.
> DECLARE INTEGER ShellExecute IN shell32.dll ; 
> INTEGER hndWin, ; 
> STRING cAction, ; 
> STRING cFileName, ; 
> STRING cParams, ;  
> STRING cDir, ; 
> INTEGER nShowWin
> cAction = "open" 
> 
> * --- Fabricate command string to execute below.
> lcCMD = "TASKKILL /F /IM " + lcAppl
> 
> * --- ShellExecute() function to run the command string.
> = ShellExecute(0,cAction,'cmd','/c '+lcCmd, '',0)

> The above is using the internal Windows TaskKill.exe and I verified
> this is still in Windows 10 and it is in by tech pre-release version
> so this will work just fine.
> Keep in mind the goal here is to accomplish without using any scripting
> as a couple of my clients have disabled all scripting on all workstations
> and I have to change all WMI calls in my applications to fix this.
>
>
> I STILL HAVE NOT RESOLVED THE GET PROCESSOR ID OR REFERED TO AS GET CPUID.
> WMI works, but not in two client site locations with scripting disabled.
>
> Pete "the IceMan", from the Great White North of Canada.
> www.marathongriffincomputers.com


Hi Pete, see this: http://sandstorm36.blogspot.com/2014/12/enumerate-and-kill-selected-windows.html

While I do not doubt TaskKill will work properly on every attempt, still it is good to have an alternative. Also, like you said, you won't be able to get the process ID using TaskKill.


P.S. The one I showed there never failed me yet on my repeated attempts here in terminating a process.


https://vfpx.codeplex.com/releases/view/99045
http://sandstorm36.blogspot.com

ENTIRE THREAD

Kill EXE API Posted by Pete Sass @ 12/29/2014 1:40:46 AM
RE: Kill EXE API Posted by Chuanbing Chen @ 12/29/2014 1:55:13 AM
RE: Kill EXE API Posted by Pete Sass @ 12/29/2014 2:09:06 AM
RE: Kill EXE API Posted by Jun Tangunan @ 12/29/2014 2:21:49 AM
RE: Kill EXE API Posted by Pete Sass @ 12/29/2014 3:11:45 AM
RE: Kill EXE API Posted by Jun Tangunan @ 12/29/2014 7:13:26 AM
RE: Kill EXE API Posted by Mike Gagnon @ 12/29/2014 3:12:39 AM
RE: Kill EXE API Posted by Jun Tangunan @ 12/29/2014 7:16:19 AM
RE: Kill EXE API Posted by Pete Sass @ 12/29/2014 12:07:30 PM
RE: Kill EXE API Posted by Mike Gagnon @ 12/29/2014 12:28:36 PM
RE: Kill EXE API Posted by Pete Sass @ 12/29/2014 1:46:26 PM
RE: Kill EXE API Posted by Greg Green @ 12/29/2014 3:44:35 AM
RE: Kill EXE API Posted by Pete Sass @ 12/29/2014 1:22:22 PM
RE: Kill EXE API Posted by Jun Tangunan @ 12/30/2014 1:30:04 AM
RE: Kill EXE API Posted by Mike Gagnon @ 12/30/2014 5:48:41 PM
RE: Kill EXE API Posted by Pete Sass @ 12/30/2014 6:20:59 PM
RE: Kill EXE API Posted by Victor Espina @ 12/29/2014 3:38:47 PM