hstraf Posted April 29, 2011 Share Posted April 29, 2011 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! Link to comment Share on other sites More sharing options...
bwochinski Posted April 29, 2011 Share Posted April 29, 2011 Check the help file for the _Singleton() function. It's designed for exactly this. PsYcHoPaTz 1 Link to comment Share on other sites More sharing options...
hstraf Posted April 29, 2011 Author Share Posted April 29, 2011 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! Link to comment Share on other sites More sharing options...
hstraf Posted April 29, 2011 Author Share Posted April 29, 2011 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now