I'm trying to execute a modal application window in a VC++ .NET project.
The project is basically a form which is used to launch various word processors in Windows; Notepad, Wordpad etc.
I'm having an extremely difficult time trying to find a way to make the Wordpad application window to be modal. (to avoid multiple copies to be opened)
Here's a snippet of code which is part of a menu option:
Expand|Select|Wrap|Line Numbers
- {
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- CreateProcess(NULL, "Write.exe", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
- WaitForSingleObject( pi.hProcess, INFINITE );
- CloseHandle( pi.hProcess );
- CloseHandle( pi.hThread );
- }