Results 1 to 5 of 5

Thread: [Delphi] Getting Running processes into a List Box and Kill Selected ??

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    120

    [Delphi] Getting Running processes into a List Box and Kill Selected ??

    Hello every one!
    I don't know if i can ask questions in this Forum..But i will any way
    - I want to ask this:
    I have 1 Listbox and 2 Buttons
    The first button get running processes into a list box and the other terminate selected process!
    Last edited by NoteMe; Jul 22nd, 2005 at 10:34 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Getting Running processes into a List Box and Kill Selected [Delphi]??

    This is not the proper place for a question, but I can move it to where it needs to go. My question is: Is this a Delphi specific question? If not, what language are you referring to?

    Thanks, and I'll move this as appropriate.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    120

    Re: Getting Running processes into a List Box and Kill Selected [Delphi]??

    Quote Originally Posted by Hack
    This is not the proper place for a question, but I can move it to where it needs to go. My question is: Is this a Delphi specific question? If not, what language are you referring to?

    Thanks, and I'll move this as appropriate.
    Yes my question is how can i make a processes nmanager in Delphi...
    Sorry if i post the question in a Code Bank forum..But there is no other Forum to post Delphi questions

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Getting Running processes into a List Box and Kill Selected [Delphi]??

    Moved from CodeBank - Other

    No, there isn't a Delphi specific forum section. The only other place that I believe this would be appropriate is in General Developer.

  5. #5
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    Re: Getting Running processes into a List Box and Kill Selected [Delphi]??

    You may populate the listbox with the win32 process list, by using:

    uses TLHelp32

    procedure TForm1.Button1Click(Sender: TObject);
    var
    MyHandle: THandle;
    Struct: TProcessEntry32;
    begin
    try
    MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
    Struct.dwSize:=Sizeof(TProcessEntry32);
    if Process32First(MyHandle, Struct) then
    ListBox1.Items.Add(Struct.szExeFile);
    while Process32Next(MyHandle, Struct) do
    ListBox1.Items.Add(Struct.szExeFile);
    except on exception do
    ShowMessage('Error showing process list');
    end
    end;


    Im guessing to kill the process you desire, simply call the Kill method on the selected listbox item

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width