Indigo Rose Software
  #1  
Old 10-03-2003
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Grin Checking If a Particular Program is Running

AutoPlay Media Studio 5.0 Knowledge Base

Checking If a Particular Program is Running

Document ID: IR10087
The information in this article applies to:
  • AutoPlay Media Studio 5.0 Professional Edition

SUMMARY

This article describes how to check if a particular program is running.

DISCUSSION

As an example, let us assume that you want to run your program, 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:

instances_of_file = 0;

--have all lowercase

file_to_check_for = "autorun.exe";

processes = Window.EnumerateProcesses();



for j, file_path in processes do

file = String.SplitPath(file_path);

if (String.Lower(file.Filename..file.Extension)) == file_to_check_for then

instances_of_file = instances_of_file + 1;

end

end



if instances_of_file > 1 then

Window.Hide(Application.GetWndHandle());

Dialog.Message("Error", "Autorun already running: code: already running");

Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);

else

Window.Show(Application.GetWndHandle());

end

MORE INFORMATION

For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:

  • Program Reference | Actions | Window | Window.EnumerateProcesses
  • Program Reference | Actions | Application | Application.GetWndHandle

KEYWORDS: AutoPlay Media Studio 5.0, Window, Application, Find, Running


Last reviewed: October 3, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT -6. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software