1. detect a running program

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.

new topic     » topic index » view message » categorize

2. Re: detect a running program

> 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 message » categorize

3. Re: detect a running program

Great, thanks. I would like to see your code to bring it to the front. I agree
that would be a better solution. Can you email it to me?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu