> How can i detect a 2nd launch of my application, popup an error message and
> then exit?
Here's a sample of how to use a mutex. A mutex is better than Ilyn's
example if your wondows title may change (if you change the title to
show the currently open document, status, etc.)
# Create or open the mutex
my $mutex = Win32::Mutex->new(1, "Mutex Test");
# Die if the mutex exists (183 == ERROR_ALREADY_EXISTS)
die "App is already running" if $^E == 183;
# Do something here
# We're done, release the mutex
Brian, Tommy, Helen and Paka -- bmillham@...
This message traveled at least 44,000 miles to reach you!
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080615-0, 06/15/2008
Tested on: 6/15/2008 10:10:48 AM
avast! is copyright (c) 2000-2008 ALWIL Software.