Anwendung will nicht minimiert/inaktiv starten - CreateProcess
-
Hi!
Ich habe jetzt ein neues CreateProcess-Problem, wobei ich mir nicht sicher bin, ob es wirklich an meinem Aufruf liegt.
Der Code ist wie folgt:void ProzessStarter::starteProzess( string p_pfad ) { STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); si.dwFlags = STARTF_USESHOWWINDOW; [i]// EGAL WELCHES!!![/i] [b]si.wShowWindow = SW_SHOWMINNOACTIVE;[/b] [b]si.wShowWindow = SW_MINIMIZE;[/b] [i]// EGAL WELCHES!!! - ENDE[/i] char* l_temp = new char[p_pfad.length() + 1]; strcpy(l_temp, p_pfad.c_str()); // Start the child process. if( !CreateProcess( NULL, // No module name (use command line) l_temp, // Command line NULL, // Process handle not inheritable NULL, // Thread handle not inheritable TRUE, // Set handle inheritance to FALSE 0, // No creation flags NULL, // Use parent's environment block NULL, // Use parent's starting directory &si, // Pointer to STARTUPINFO structure &pi ) // Pointer to PROCESS_INFORMATION structure ) // Close process and thread handles. delete l_temp; CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); }Wenn ich jetzt bsw. Teamspeak (TS2) starten will, dann sieht man, dass sich TS öffnet und dann minimiert. Notepad tut das nicht, das geht gleich minimiert auf. Da ich TS parallel zu einem starten möchte (per Logitech G15) ist das kurze Aktivieren des TS-Fensters schXXXe, weil dabei aus dem Spiel heraus gewechselt wird.
xfire verhält sich änlich, nur dass es den Focus nicht einmal mehr abgibt.Habt Ihr eine Idee, kann man einer Anwendung soetwas evtl. auch anders bebringen?!
-
Hm glaube das liegt an der Implemenation der Anwendung selbst. Schonmal SW_HIDE probiert (ggf. anschließend mit
ShowWindow(FindWindow(...), SW_MINIMIZE);nachträglich minimieren) ?
-
Die Komibnation hatte ich noch nicht. Aber HIDE klappte schon nicht:
Notepad war nur im Taskmanager zu sehen, TS ging normal auf. Dann bringt das MINIMIZE hinterher vermutlich auch nichts mehr.
Noch eine Idee? An TS-Systems habe ich schon geschrieben....