HOW TO CLOSE AN APP WITH ANOTHER
-
Hi, I have two applications and want to close one by clicking on command button from the other application. I know that i must use theses functions : CreateMutex, OpenMutex, FindWindow , ... But i don't know how to realize this action Can anybody help me . Thanks in advance
-
Hi, I have two applications and want to close one by clicking on command button from the other application. I know that i must use theses functions : CreateMutex, OpenMutex, FindWindow , ... But i don't know how to realize this action Can anybody help me . Thanks in advance
-
Do you own the two applications ? Or do you want to kill a third party application from your own application ? ~RaGE();
-
Hi, I have two applications and want to close one by clicking on command button from the other application. I know that i must use theses functions : CreateMutex, OpenMutex, FindWindow , ... But i don't know how to realize this action Can anybody help me . Thanks in advance
-
Hi, I have two applications and want to close one by clicking on command button from the other application. I know that i must use theses functions : CreateMutex, OpenMutex, FindWindow , ... But i don't know how to realize this action Can anybody help me . Thanks in advance
If you can get a handle to the other app the SedMessage( .. WM_CLOSE .. ) or something like that should work fine. Please don't SHOUT at us. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
-
No i don't want to kill a third party application. The two application are mine ( created with visual C++6.0) Thanks
Then use a user defined message (search for this here on CP or in MSDN), and use SendMessage() or PostMessage() in the first application to send it to your second application. In your second application (the one which ought to be terminated), handle your message in the message map, and end your application calling DestroyWindow() or OnOK() if it is a MFC dialog. ~RaGE();
-
HWND hWnd = ::FindWindowEx(NULL, NULL, NULL, "Calculator" ); if (!hWnd) { AfxMessageBox("Could not find \"Calculator\" window"); return; } else ::PostMessage(hWnd, WM_CLOSE, 0, 0);
This is the easiest way in most cases. John