Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5

Thread: Kill a process

  1. #1
    Join Date
    Nov 2006
    Location
    Quebec, Canada.
    Posts
    432

    Kill a process

    Hello,

    I looked at some exemples and said "Cool! That's simple". But I tried and got... nothing. It's probably due to the table colums, which I don't know. So the code:

    Code:
    -- Get the titles and window handles of all open windows.
    windows = Window.EnumerateProcesses();
    
    -- A variable containing text in the title you want to search for.
    window_name = "Apache.exe";
    
    -- Loop through the table of windows.
    for handle, title in windows do
    
        -- Check if the window title has the target text.
        result = String.Find(title, window_name, 1, false);
    
        -- if the string was found in the title, send the window a close message.
        if (result ~= -1) then
            Window.Close(handle, CLOSEWND_SENDMESSAGE);
        end
    end
    I think you undertsood I wanted to kill the process named "Apache.exe". So does anybody sees the error?
    Thanks!

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    i think when referring to a process, it all has to be lowercase, give it a shot
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Nov 2006
    Location
    Quebec, Canada.
    Posts
    432
    Ok, thanks, will try this

  4. #4
    Join Date
    Sep 2007
    Posts
    15
    Easy use this in Dos command

    TASKKILL /?

  5. #5
    Join Date
    May 2006
    Posts
    5,380

    Huh!

    why would you want to use a dos command when ams already has a command (which uses the winAPI) to handle such a task


    Code:
    Window.Close(handle, CLOSEWND_TERMINATE);
    Open your eyes to Narcissism, Don't let her destroy your life!!

Similar Threads

  1. Terminating a Process?
    By Shivansps in forum Setup Factory 7.0
    Replies: 5
    Last Post: 06-16-2007, 04:09 PM
  2. Detecting a process has finished
    By Gonzo in forum Setup Factory 7.0
    Replies: 5
    Last Post: 04-07-2006, 11:27 PM
  3. Function: Terminate Process
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-17-2004, 10:53 AM
  4. Kill a process
    By mst in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 04-06-2004, 06:33 PM
  5. Search for running process ?
    By cyberwebwerks in forum AutoPlay Media Studio 4.0
    Replies: 1
    Last Post: 09-08-2003, 01:15 PM

Posting Permissions

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