Bringing another application to the front
-
I have a handful of applications that I am working with, and depending on which of them has created a named mutex, that application is brought to the front when another application is run. The named mutex is shared amoungst all applications. So, if application A is running and creates a named mutex 'my_mutex', when application is started is checks to see if there is already a named mutex of 'my_mutex'. If there is, then application B brings A to the front, and application B is terminated. What I am having a hard time with is finding a way to get a handle to the application that has created the mutex - sometimes it is B that is running and has created the mutex, and A is the one that gets terminated. I had been using CWnd::FindWindow(), but that implies I know the name of the application with the mutex, which I do not know. Any ideas on how to tackle this problem? : Dean 'Karnatos' Michaud
-
I have a handful of applications that I am working with, and depending on which of them has created a named mutex, that application is brought to the front when another application is run. The named mutex is shared amoungst all applications. So, if application A is running and creates a named mutex 'my_mutex', when application is started is checks to see if there is already a named mutex of 'my_mutex'. If there is, then application B brings A to the front, and application B is terminated. What I am having a hard time with is finding a way to get a handle to the application that has created the mutex - sometimes it is B that is running and has created the mutex, and A is the one that gets terminated. I had been using CWnd::FindWindow(), but that implies I know the name of the application with the mutex, which I do not know. Any ideas on how to tackle this problem? : Dean 'Karnatos' Michaud