Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2006
    Posts
    62

    Grin I need to save all currently running processes in a table via "NameFile.Extension"

    I need to save all currently running processes in a table via "NameFile.Extension"
    i need a result look like:
    table={"autorun.exe", "services.exe","winlogon.exe", "smss.exe", "spoolsv.exe","svchost.exe", "csrss.exe", "system idle process", "system", "svchost.exe", "alg.exe", "ctfmon.exe", "sqlwriter.exe", "sqlservr.exe"};

    I see contents of above table in Task Manager .
    AMS help not help me in this case.

  2. #2
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    table = System.EnumerateProcesses()

  3. #3
    Join Date
    Jun 2006
    Posts
    62
    Hi ShadowUK
    It is not a real table!
    It's a table whit special contents.
    I need to get content look like:table={"autorun.exe", "services.exe","winlogon.exe"};

    "NameFile.Extension"

    please run it and see result:
    PHP Code:
    processes System.EnumerateProcesses();
    numLoopCount 1;
    repeat
        result 
    Dialog.Message("msg"processesMB_OKMB_ICONINFORMATIONMB_DEFBUTTON1);
        
    numLoopCount numLoopCount 1;
        if (
    processes[numLoopCount] == nilthen Application.ExitScript(); end
    until numLoopCount
    ==50
    Last edited by 123456789; 04-29-2008 at 10:27 AM.

  4. #4
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Quote Originally Posted by 123456789 View Post
    Hi ShadowUK
    It is not a real table!
    It's a table whit special contents.
    I need to get content look like:table={"autorun.exe", "services.exe","winlogon.exe"};

    "NameFile.Extension"

    please run it and see result:
    PHP Code:
    processes System.EnumerateProcesses();
    numLoopCount 1;
    repeat
        result 
    Dialog.Message("msg"processesMB_OKMB_ICONINFORMATIONMB_DEFBUTTON1);
        
    numLoopCount numLoopCount 1;
        if (
    processes[numLoopCount] == nilthen Application.ExitScript(); end
    until numLoopCount
    ==50
    What do you mean? It is a real table, You're theory of tables is a lot different to the real lua tables, anyway. I fixed up your code, Seriously though, You're trying to Dialog.Message a table, The second argument allows strings, Not tables!

    PHP Code:
    local NewTable = {};

    for 
    idpath in System.EnumerateProcesses() do
        
    NewTable[Table.Count(NewTable) + 1] = String.SplitPath(path).Filename    
    end

    local StringedTable 
    Table.Concat(NewTable"\r\n"1, -1);

    Dialog.Message("Processes Running:"StringedTable); 

  5. #5
    Join Date
    Dec 2007
    Location
    Missouri, United States
    Posts
    476
    Here's a couple of function's I made that do what your wanting.

    Function 1 - Populates process name and path to a Tree
    Code:
    function PopulateProc2Tree()
      processes = System.EnumerateProcesses();
      for i,p in processes do
        proc = String.SplitPath(p);
        procNodeProp = {}
        procNodeProp.Text = String.Lower(proc.Filename..proc.Extension)
        procNodeProp.Data = p
        Tree.InsertNode("Tree1", "1", procNodeProp);
      end
    end
    Function 2 - Creates a table of all process name's and converts them to a string.
    Code:
    function proc2table()
      processes = System.EnumerateProcesses();
      ind = 0
      tblCproc = {}
      for i,p in processes do
        proc = String.SplitPath(p);
        procnam = String.Lower(proc.Filename..proc.Extension);
        ind = ind + 1
        Table.Insert(tblCproc, ind, procnam);
      end
      proclist = Table.Concat(tblCproc, "\r\n", 1, TABLE_ALL);
      Dialog.Message("Notice", proclist, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end
    If you use function2 and you really want the table returned delimited by ; then change the following line....

    Code:
    proclist = Table.Concat(tblCproc, "\r\n", 1, TABLE_ALL);
    to

    Code:
    proclist = Table.Concat(tblCproc, ";", 1, TABLE_ALL);
    -Personal Note-
    Everything I have done in the above functions could have been easily found out via the help file. Read it carefully and it should explain itself. [Not givin ya a hard time but this one should have been relatively easy for you, as everything is outlined in the helpfile.]
    Last edited by TimeSurfer; 04-29-2008 at 12:19 PM.

  6. #6
    Join Date
    Jun 2006
    Posts
    62
    shadowuk, U are a great man.
    Thanks a lot for your Kindness to me.
    Codes is very usefull for i and other user.
    TimeSurfer
    I enjoy from your ASCENDENCY Intellect.
    I hopes be you Prosperous in life and jobs always.
    Thanks for all helps.

    123456789
    ----------

  7. #7
    Join Date
    Dec 2007
    Location
    Missouri, United States
    Posts
    476
    lol just my wymsical humor lol and no problem m8 happy to help

Similar Threads

  1. Processes running disable button
    By bobbie in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 10-16-2007, 04:40 PM
  2. help with save as
    By Dangerscott2020 in forum AutoPlay Media Studio 6.0
    Replies: 10
    Last Post: 07-05-2007, 12:38 AM
  3. Checking If a Particular Program is Running
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-03-2003, 01:31 PM
  4. Creating a Table of Contents
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-03-2003, 11:35 AM
  5. Displaying a Save As Dialog
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-01-2003, 03:53 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