Sign in to follow this  
Followers 0
hstraf

How to limit autoit executable file to only one instance running?

4 posts in this topic

I am trying to figure out how to limit the user to running only *one* instance of the autoit program I created.

The problem is that they might have renamed the program to somethingelse.exe, so I can't just check the running processes.

The program "lives" in the system tray, and I can't seem to find any associated window...

Is there a way to easily do this? Maybe I can specifically "name" the program window, and then look for this window when starting the next instance.. then exit if it exists?

Thanks!

Share this post


Link to post
Share on other sites



Check the help file for the _Singleton() function. It's designed for exactly this.

Share this post


Link to post
Share on other sites

Ah... I figured it out by using the "_Singleton()" function:

; Test to make sure there is not already an instance running.
if _Singleton($ProgramName, 1) = 0 Then
    Msgbox(64, $ProgramName, "The program is already running.")
    Exit
EndIf

Cheers!

Share this post


Link to post
Share on other sites

Thanks bwochinski, it looks like we were posting at the same time.

What I really need is a help file that will read my mind! :unsure:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0