Recent

Author Topic: Kill Exe identified from path [SOLVED]  (Read 4850 times)

LA.Center

  • Full Member
  • ***
  • Posts: 244
    • LA.Center
Kill Exe identified from path [SOLVED]
« on: June 03, 2012, 09:07:50 am »
Hi, can anyone help me with killing a running exe identified by its path and as a second killing all running exe's identified by its name.

I found some code for Delphi, to get started but could not make it work.

http://www.swissdelphicenter.ch/torry/showcode.php?id=266

any help is highly appreciated

thx.
« Last Edit: June 03, 2012, 10:43:29 am by plusplus »

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Kill Exe identified from path
« Reply #1 on: June 03, 2012, 10:12:27 am »
What is not working?
If you are looking for tlhelp32, fpc includes JwaTlHelp32 which is the jedi port of tlhelp32. Adding windows,JwaTlHelp32 to the uses clause and KillTask works fine.

TProcessEntry32.szExeFile is not the full path of the exe but only the filename. If you need the full path you need to use also Module32First and TModuleEntry32.szExePath
A C example can be found at the bottom of http://msdn.microsoft.com/en-us/library/windows/desktop/ms684225(v=vs.85).aspx

LA.Center

  • Full Member
  • ***
  • Posts: 244
    • LA.Center
Re: Kill Exe identified from path
« Reply #2 on: June 03, 2012, 10:43:15 am »
@ludob

thx, indeed JwaTlHelp32 was the answer :) I have it now working.

 

TinyPortal © 2005-2018