windows - How to check in C++ if an application is already running before launching a new instance? -



windows - How to check in C++ if an application is already running before launching a new instance? -

i have found few references implementation 1 clear description in c++ (joseph newcomers article http://www.flounder.com/nomultiples.htm#createmutex), (c)1999 little reluctant utilize without first checking if there "newer/better" ways today.

thanks

any named object do, can file, mutex, event, mailslot, tcp port, etc. error_already_exists tells whether instance existed.

for objects in win32 kernel namespace, there 1 alter since 1999 -- because of terminal services, can utilize prefix of global\ or local\ specify whether it's 1 instance on entire computer vs 1 per user logon session.

if want more portable, binding tcp port, or creating file , exclusively locking it, tend work across variety of oses.

c++ windows

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -