Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Downloads
Search: 

Process Tools for VFP
Lucian Constantin, Angst Ro S.A.
Source (.PRG) library for killing processes from within VFP, or getting a list of running processes. Is written in pure VFP code, dealing with Win32 API calls and it does not need any DLL, FLL or other files like other "killers"... Works with any (?) operating system (Tested with Win98SE, ME, 2k, XP and NT with VFP 6, 7 and 8).
Created on
20 years ago
Downloads
2278
File type
Rating
5.00/5.00
General information
Rating:
5.00/5.00 (1 rate) Rate this item
Description
On Windows NT you will need PSAPI.DLL that can be downloaded from Microsoft's site at: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=3D1FBAED-D122-45CF-9D46-1CAE384097AC ----------- The library is simple to use as SET LIBRARY TO PROCESS_TOOLS then call the functions you need. There are implemented 4 functions: - ProcID("ExeFileName") - returns the process ID of the EXE file name you specify Example: ? ProcID("notepad.exe") returns process ID for Notepad or 0 (zero) if no process "notepad" is found. - KillProcID(lnProcID) - it kills the process ID specified as parameter, and returns a non zero value if it successfully killed the process or zero if not. Example: ? KillProcID("1234") will return 0 if process ID "1234" is not found - KillProcN("ExeFileName") - will kill the process name given as parameter and return non zero value if succeeds or a zero value if it fails. Example: ? KillProcN("notepad.exe") will return 0 if no Notepad process found. is same as KillProcID(ProcID("notepad.exe")) but is too much to type... - ProcList("laProcessesArray") - will create an array of processes founded and return the number of processes, or zero if it fails. If the array passed as parameter does not exist, it will be created. Example: ? ProcList("laProcesses") will display the number of running processes. * Column description of processes array: 1 - Process identifier 2 - Number of execution threads started by the process 3 - Process identifier of the process that created this process (its parent process) 4 - Base priority of any threads created by this process 5 - String that specifies the name of the executable file for the process NOTE: On Windows NT columns 2,3,4 will always be 0 (zero)! For a little "drive-test" DO DEMO. Known bugs ---------- - In WinNT it cannot properly identify all the process names - in fact only 2 in my tests: ProcID 2 - "System" process because it has no "exe" name to find ProcID 30 - "CSRSS.EXE" because I don't know why ProcID's were always the same for these 2 processes in my tests but I can't be shure will be allways the same - here will be helpful any feedback if these processes remain the same... Credits ------- Thanks to Ilya Rabyy for pointed out a major bug in Win9x and ME, and done some refining and cosmetics. Final word ---------- Killing processes can be dangerous so again use it with caution, at your own risk. For any suggestions or comments you can write to: me: Lucian Constantin e-mail: lucian_AT_angst_DOT_ro ( but replace _AT_ and _DOT_ accordingly). The "process_tools" library can be downloaded as alternative from the following address: http://www.angst.ro/users/lucian/vfp/process_tools_1_2.zip Version History --------------- 1.2 - Added code to run on WinNT so now it should work on ANY Windows version greater than 95 and preserves backward compatibility with previous version(s)! 1.1 - Major bug solved in Win98 and WinME, now will correctly identify the process thanks to Ilya Rabyy, because I test it only on XP - shame on me - ;-( - Some parameters checking and some "cosmetics" (2004-03-30) 1.0 - Initial release (2004-03-29) v.1.2. (2004-06-07)
Created by
Lucian Constantin, Angst Ro S.A.

Comments
The link does not exist Jim Shepard, June 7, 2004

The file was uploaded (sent by e-mail to UT) at same moment with the update on the site but it seems that some policies on UT make the new file appear few hours later... so it should appear soon... Or... in the meantime you can donwload it as alternative from: http://www.angst.ro/users/lucian/vfp/process_tools_1_2.zip Lucian Constantin, June 8, 2004

June 15, link is still dead. Paul Pedersen, June 15, 2004

Add a comment