Jump to content

See If Already Running.


Recommended Posts

I want to check to see if my autoit exe is already running. Is there a way to get the PID of self?

And when I use WinGetProcess which PID will it return? The Pid of the other autoit exe or the PID of the autoit exe I just started?

I tried:

if WinGetProcess("magreader.exe") = -1 Then
   MsgBox(0,"Already Running", "The Magstripe Reader is already running use ALT-SHIFT-D to access")
   exit
EndIf

And of course it exits every time cause of course magreader.exe is running.

Link to comment
Share on other sites

maybe

$g_szVersion = "My XP Cleaner"
If WinExists($g_szVersion) Then
    MouseMove(500,5)
    MsgBox(262208, "* NOTE * ", "*XPClean Menu* was already running  ", 5)
    SoundPlay ($Sound_lnk,1)
    Exit; It's already running
EndIf
AutoItWinSetTitle($g_szVersion)

thats what i use

8)

NEWHeader1.png

Link to comment
Share on other sites

  • Developers

I want to check to see if my autoit exe is already running. Is there a way to get the PID of self?

And when I use WinGetProcess which PID will it return? The Pid of the other autoit exe or the PID of the autoit exe I just started?

I tried:

if WinGetProcess("magreader.exe") = -1 Then
   MsgBox(0,"Already Running", "The Magstripe Reader is already running use ALT-SHIFT-D to access")
   exit
EndIf

And of course it exits every time cause of course magreader.exe is running.

Check out the standard udf _Singleton()

:think:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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