Here's the setup: App #1 has a push button that launches app #2, and it waits for app #2 to exit before becoming active again using this code:
Here's the problem: If the user clicks on the button multiple times (even after app #2 has launched), even though the application is non-responsive, it appears to hold onto the mouse events and will process them once app #2 has exited. This of course results in app #2 being relaunched again and again depending on how many times you "clicked" the button.
How do I keep app #1 from processing these messages?
Code:
if(CreateProcess(appName, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
{
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
}
How do I keep app #1 from processing these messages?