OneManPen Posted December 27, 2011 Share Posted December 27, 2011 Hey all, I'm working on a launcher program, were you set the settings for the application before you start it. It's a tray based program so I'm worried that the user will start the application multiple times without knowing it's open ... So I was wondering if there was any kind of logic and faster way to check if the launcher is running... I was thinking of maybe renaming the process name in the process list so the new launcher would look for the new name, not the name it started by... But I'm not quite sure how to do that Link to comment Share on other sites More sharing options...
jaberwacky Posted December 27, 2011 Share Posted December 27, 2011 Look into Singleton in the helpfile. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
nitekram Posted December 27, 2011 Share Posted December 27, 2011 _singleton() in help file might be what you want? 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
MilesAhead Posted December 27, 2011 Share Posted December 27, 2011 (edited) If coding a launcher ProcessExists() is likely more useful. Maybe have a setting if more than one instance should be run. For instance(no pun intended) something like Notepad it might be fine if they have 4 copies running. But something like Personal Video Database it may be sensible to run only one. Edited December 27, 2011 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
kylomas Posted December 27, 2011 Share Posted December 27, 2011 milesahead, I believe sleepercell42 is talking about multiple copies of the launcher app, not what it might start... kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
MilesAhead Posted December 27, 2011 Share Posted December 27, 2011 (edited) milesahead,I believe sleepercell42 is talking about multiple copies of the launcher app, not what it might start...kylomasI see it now. Due to Icon in Tray the user might not know it's running. When I read it the first time it seemed like the OP wanted to prevent continuous launches of duplicate client apps. (Musta' been that error dialog that threw me off) Edited December 27, 2011 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
JohnOne Posted December 28, 2011 Share Posted December 28, 2011 In the case of checking for multiple instances of external process I would advice ProcessList("process.ext")Check for error, check $array[0][0] for number of processes. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
martin Posted December 28, 2011 Share Posted December 28, 2011 (edited) Singleton has the advantage that it's not dependent on the exe name, so if someone renames or copies an exe and runs it again you will still know, but with ProcxessExists or ProcessList you wouldn't. Edited December 28, 2011 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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