views:

129

answers:

2

I have a listbox that lists windows processes by their handle title, e.g. "Untitled - Notepad". What I would like to do is regularly check (using a timer?) if those processes are still open. I have stumbled across some code below, but that only takes one argument "string". I assume it would have to be an array of all items in the listbox that would have to be passed. Then immediately show which process(es) have been closed (handle title) in a message box.

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

Thanks!

A: 

You can make a loop to iterate all the process names in the Listbox and check if they are running or not. Or better way is to refill the ListBox again and get the Opened Process.

Wael Dalloul
A: 

Algorithm is very simple. 1) Read a list of running processes and remember it in sorted array of cardinal (you can store only process PID). 2) After second, read again and compare new list with previous one. Where is the problem?

How obtain Windows processes list?
Implementing QuickSort Sorting Algorithm in Delphi

inzKulozik
Thanks will try and figure out how to do this...
emC