Re: detect a running program

new topic     » goto parent     » topic index » view thread      » older message » newer message

> Using win32, is there a way to detect if a program is already running. I =
want
> to check if a program is already running. If so I don't want to launch it=
 a
> 2nd time. I can't seem to find a reference it the archives.

Assuming you mean Win32Lib, do this:

if setAppName( "My App Name" ) then
    -- another instance is already running
    abort( 0 )
end if


Works like a charm! I also have some longer code that will bring that
running app to the front, which is a more appropriate behavior. Let me
know if you'd like to see that code.

~Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu