Jump to content



Photo

Only one Istance


  • Please log in to reply
2 replies to this topic

#1 apollo13

apollo13

    Wayfarer

  • Active Members
  • Pip
  • 94 posts

Posted 23 March 2012 - 11:12 AM

Hello, I ask to forum an other question in order to implement a new function to my program named START.AU3

Someone can suggest me how start only one istance of my program??
When I compile STARTau3 to EXE and I run it i want that it run only on the first mouse click on exe file.
If I click an other time it must do nothing beacuse it is already in memory.

I have thinked to command "IF PROCESSEXIST ...-START.exe-" but the problem is that the process always exist
when I run it.
If I think NOT exist is always false beacuse when I run it automatically exist in memory.
I have think PID but nothing to do.

The only way that permit me that is create a file START-RUN.txt and test if the file exist or not....
and delete file when I close program
..but there is a bug....
if computer shutdown when START is running (breaking tension voltage or other problems) the file always exist
but START is NOT running.


Someone have suggestion??
Thanks







#2 water

water

    ?

  • MVPs
  • 16,671 posts

Posted 23 March 2012 - 11:13 AM

Function _Singleton is made for this.

[color=rgb(0,0,0);]UDFs: [/color]
[color=rgb(255,140,0);]Active Directory[/color] [color=rgb(0,0,0);]([/color][color=rgb(0,0,0);][color=rgb(0,0,255);]2014-07-21[/color] - [/color][color=rgb(255,0,0);]Version 1.4.1.1[/color][color=rgb(0,0,0);])[/color] - Download - General Help & Support - Example Scripts - [color=rgb(255,0,0);]Wiki[/color]
[color=rgb(255,140,0);]OutlookEX [/color] [color=rgb(0,0,0);]([/color][color=rgb(0,0,0);][color=rgb(0,0,255);]2014-07-27[/color] - [/color][color=rgb(255,0,0);]Version 1.0.0.0[/color][color=rgb(0,0,0);]) [/color]- Download - General Help & Support - Example Scripts - [color=rgb(255,0,0);]Wiki[/color]
[color=rgb(255,140,0);]ExcelChart [/color] [color=rgb(0,0,0);]([color=rgb(0,0,0);][color=rgb(255,0,0);]NEW [/color][/color][/color][color=rgb(0,0,0);][color=rgb(0,0,255);]2015-04-01[/color] - [/color][color=rgb(255,0,0);]Version 0.4.0.0[/color][color=rgb(0,0,0);]) [/color]- Download - General Help & Support - Example Scripts
[color=rgb(255,140,0);]Excel [/color]- Example Scripts - [color=rgb(255,0,0);]Wiki[/color]
[color=rgb(255,140,0);]Word[/color] - [color=rgb(255,0,0);]Wiki[/color]
[color=rgb(255,140,0);][color=rgb(0,0,0);]Tutorials: [/color][/color]
[color=rgb(255,140,0);]ADO[/color] - [color=rgb(255,0,0);]Wiki[/color]


#3 apollo13

apollo13

    Wayfarer

  • Active Members
  • Pip
  • 94 posts

Posted 23 March 2012 - 11:55 AM

Function _Singleton is made for this.


Thanks :-)))
I implement immediately it.

Best Regards




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users