Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2007
    Posts
    16

    Deny execution of a program

    Hello IndigoRose Community,

    I am new to this forums and i have to admit that this software really amazed me.
    Since i am not really familiar with it yet i would like you to lend a hand on my question if its possible of course.

    What i want to do is to deny the execution of a program when some other programs are running.
    For example i don't want my program to be started when on the task manager's Processes there are some names of programs which i defined.

    Actually i can't really know even if this is possible but any information on this would be great.

    Thanks guys.

  2. #2
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    have a look in the help file.

    Check if a Particular Program is Running
    As an example, let us assume that you want to run your program (autorun.exe) only if
    there is not another autorun.exe running on the system. To accomplish this, use the
    Window.EnumerateProcesses action and check every process against the filename
    autorun.exe.
    Insert the following code into the On Show event of your page:
    -- Initialize variables
    instances_of_file = 0;
    file_to_check_for = "autorun.exe"; --have all lowercase
    processes = Window.EnumerateProcesses();
    -- Step through process table
    for j, file_path in processes do
    -- Split path to get filename
    file = String.SplitPath(file_path);
    -- compare filename to the file specified in variable initialization
    if (String.Lower(file.Filename..file.Extension)) == file_to_check_for then
    -- The process matches, increment count by 1.
    instances_of_file = instances_of_file + 1;
    end
    end
    -- Check if at least one file matched
    if instances_of_file > 0 then
    -- There was at least one match, hide this application window, display error, and
    close.
    Window.Hide(Application.GetWndHandle());
    Dialog.Message("Error", "Another instance of Autorun.exe is already open.");
    Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);
    end
    Page

  3. #3
    Join Date
    Aug 2007
    Posts
    16
    oh, how bad of me.
    Thats the first thing I should do, but i couldn't imagine that it would be on Windows Actions.

    But what i asked is if we can prevent even the first execution not the second, i tried adding another name other than autorun.exe but my program started with no errors.
    Anyway thanks for the info

    EDIT: Sorry again, i just had to chage "if instances_of_file then" and the remove the > 1
    Last edited by EndlessLay; 08-16-2007 at 06:03 PM.

  4. #4
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Thats ok, i do the same thing sometimes.
    This for FPSC?

  5. #5
    Join Date
    Aug 2007
    Posts
    16
    Hello again,

    Actually now i noticed something else.

    My Application won't start ONLY when the defined app is shown on "Applications" tab , but when its shown on "Processes" tab my program runs normally

    A lot of programs after minimizing them to try aren't shown on "Applications" tab, so is there any way to make it ready from Processes tab as well?


    Ps.No actually is for a game loader,where i want the game not to be started when some illegal software programs are running.
    Last edited by EndlessLay; 08-16-2007 at 06:38 PM.

  6. #6
    Join Date
    Aug 2007
    Posts
    16
    Sorry for doubleposting, but for one more time i found out how to fix.
    Actually it was an issue with the TopLevel == false that i forgot to add.
    Now its tested and works ok.
    Thanks again.

Similar Threads

  1. ANSI To UNICODE Is Finished!
    By coderanger in forum AutoPlay Media Studio 6.0
    Replies: 7
    Last Post: 08-13-2007, 09:27 AM
  2. Checking/closing program if it runs...
    By simondk in forum TrueUpdate 2.0
    Replies: 4
    Last Post: 03-23-2007, 04:55 AM
  3. Replies: 4
    Last Post: 02-08-2007, 06:30 AM
  4. Error message when running a setup
    By me0007 in forum Setup Factory 6.0
    Replies: 15
    Last Post: 10-19-2004, 06:05 AM
  5. Evaluating result of program execution
    By krluck in forum Setup Factory 5.0
    Replies: 1
    Last Post: 12-13-2000, 10:03 AM

Posting Permissions

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