Detect if an application is running

From ISXKB

(Difference between revisions)
Jump to: navigation, search
(Look for a Class Name)
(Look for a Window Name)
Line 20: Line 20:
and get window handle if found. It is possible to use this handle to send window messages.
and get window handle if found. It is possible to use this handle to send window messages.
-
== Look for a Window Name ==
+
== Checking for a Window Name ==
Instaed of class it is possible to find a window if an application looking for windowname.  
Instaed of class it is possible to find a window if an application looking for windowname.  
-
  function FindWindowByWindowName(const WindowName: String): Longint;  
+
  function FindWindowByWindowName(const WindowName: String): Longint;
== Look for a running executable file ==  
== Look for a running executable file ==  
By using [[PSVince]] it is possible to detect if an executable is running.
By using [[PSVince]] it is possible to detect if an executable is running.

Revision as of 01:44, 7 February 2007

There are many ways to do that, looking for a mutex, a class, a window or a runnnig exe.

See also HOWTO: Detect instances running in any user session with AppMutex on Inno Setup Knowledge Base.


Contents


Checking for a Mutex

It is possible to use

function CheckForMutexes(Mutexes: String): Boolean;

to check for a specified mutex, to see which mutexes are created by an application you can use ProcessExplorer.

Checking for a Class Name

It is possible to use

function FindWindowByClassName(const ClassName: String): Longint; 

and get window handle if found. It is possible to use this handle to send window messages.

Checking for a Window Name

Instaed of class it is possible to find a window if an application looking for windowname.

function FindWindowByWindowName(const WindowName: String): Longint;

Look for a running executable file

By using PSVince it is possible to detect if an executable is running.

Personal tools
Ads: