Windows NT calls applied for enumerating processes:
CloseHandle
EnumProcesses
EnumProcessModules
GetModuleBaseName
GetModuleFileNameEx
OpenProcessWindows 98/Me needs a different set of calls
CloseHandle
CreateToolhelp32Snapshot
Process32First
Process32NextFoxPro code samples:
Terminating all running applications from a VFP programhttp://www.news2news.com/vfp/?example=243Enumerating Processes -- Win9*http://www.news2news.com/vfp/?example=164Enumerating Processes -- WinNThttp://www.news2news.com/vfp/?example=162There are several ways of terminating a process. You might send
WM_QUIT message to the window associated with a process. This works not every time, and even more reliable way is sending
WM_SYSCOMMAND message with
S_CLOSE parameter.
Sometimes none of these helps, so you have a last resort -- a heavy bombardment --
TerminateProcess API function. This function is a kind of destructive one, an application terminated may leave some files open, system resources not properly released etc.