Jump to content

Logical way of checking if two of the same proccesses are running.


 Share

Recommended Posts

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

_singleton() in help file might be what you want?

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."

 

WindowsError.gif

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

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 by MilesAhead
Link to comment
Share on other sites

milesahead,

I believe sleepercell42 is talking about multiple copies of the launcher app, not what it might start...

kylomas

I 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 by MilesAhead
Link to comment
Share on other sites

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 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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...