In order to maximize the main window of the application, the first step is to find this window:
DWORD dwProcessId, dwPid = 0; HWND hWnd; dwProcessId = ... // ID процесса, окно которого ищем for (hWnd = ::FindWindowEx(NULL, NULL, NULL, NULL); hWnd != NULL; hWnd = ::FindWindowEx(NULL, hWnd , NULL, NULL)) { ::GetWindowThreadProcessId(hWnd, &dwPid); if (dwPid == dwProcessId) break; } _ASSERTE (hWnd != NULL); // Еще лучше вместо ассерта сделать нормальную обработку ошибки
After the handle of the window is found, you can work with it in the usual way, for example, call
::ShowWindow(hWnd, SW_SHOWMAXIMIZED);