Jump to content

how prevent multiple start of a UNIGUI-Exe?


Schlingel

Recommended Posts

Hi

 

Having another app that gets a list of running processes and takes your target exe as a parameter is one easy way to achieve this.

The attached code and compiled exe do just that.

 

the useage is 'launcher ExeToAttemptStart ParametersToExe'

 

e.g.

 

  launcher c:\myprojects\app1\myapp.exe "some list of parameters that are optional"

 

The included batch file 'runit.bat' tries to start notepad and open abc.txt - it will only open notepad if it's not already running.

 

The app uses shellexecute to start the target and makes no attempt to hide the parent process so there is potential to tidy it up!

Running launcher without any parameters simply opens the mainform with the option to view all running processes.

You can modify/ extend the function isrunning to include specific users and or paths rather than just the exe name. 

 

I found the original code here

  http://forum.codecall.net/topic/72604-getting-running-processes-list/

some years ago and have used it for a while without issue.

 

May be of some help?

 

Cheers

 

 

launcher.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...