Article View: comp.os.ms-windows.programmer.misc
Article #2929Re: How to avoid multiple instances of a program in NT and 95?
From: Heiner Eichmann
Date: Wed, 05 Feb 1997 00:00
Date: Wed, 05 Feb 1997 00:00
29 lines
1647 bytes
1647 bytes
raymondc@microsoft.com.--- (Raymond Chen) wrote: >This still won't work if a second instance is started before the >first gets a chance to create its window. >Create a named event and check if you get ERROR_ALREADY_EXISTS >from GetLastError. Hi! What happens if the program crashes before it can release the event? It is improbably also possible that a different program uses the same name for an event. What about this: Open your own EXE file for read access and do not allow other tasks to open the file. If this fails someone als has a lock on this file and another instance is still running. Yours Heiner Eichmann Inst. of Quantum Optics University of Hanover, Germany h.eichmann@mbox.iqo.uni-hannover.de
Technical Details
Message-ID:
<5da29d$bs$2@newsserver.rrzn.uni-hannover.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<5d4eeb$n6u$1@euler.space.net> <aFwHpCAU3e9yEwa8@ormesci.demon.co.uk> <32f7e6e5.422962@157.55.96.156>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1124cf,3403ef0501dd273 X-Google-Attributes: gid1124cf,public X-Google-Thread: 113dfb,3403ef0501dd273 X-Google-Attributes: gid113dfb,public X-Google-Thread: 105df1,3403ef0501dd273 X-Google-Attributes: gid105df1,public X-Google-Thread: f6ef4,3403ef0501dd273 X-Google-Attributes: gidf6ef4,public From: h.eichmann@mbox.iqo.uni-hannover.de (Heiner Eichmann) Subject: Re: How to avoid multiple instances of a program in NT and 95? Date: 1997/02/05 Message-ID: <5da29d$bs$2@newsserver.rrzn.uni-hannover.de> X-Deja-AN: 214609490 references: <5d4eeb$n6u$1@euler.space.net> <aFwHpCAU3e9yEwa8@ormesci.demon.co.uk> <32f7e6e5.422962@157.55.96.156> organization: Inst. f Quantenoptik, Uni Hannover newsgroups: comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.win32,de.comp.os.ms-windows.programmer,fido.ger.windows.prog