logic: don't hide windows console of foreign process

This commit is contained in:
mlangkabel
2017-08-23 11:52:51 +02:00
parent 09d78308be
commit 937ae0355b
+9 -2
View File
@@ -207,7 +207,7 @@ int main(int argc, char *argv[])
MessageStatus(
std::string("Starting Sourcetrail ") +
(utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? "32" : "64") + " bit, " +
(utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? "32" : "64") + " bit, " +
"version " + version.toDisplayString()).dispatch();
commandline::CommandLineParser commandLineParser(version.toString());
@@ -281,7 +281,14 @@ int main(int argc, char *argv[])
else
{
#ifdef _WIN32
ShowWindow(GetConsoleWindow(), SW_HIDE);
HWND consoleWnd = GetConsoleWindow();
DWORD dwProcessId;
GetWindowThreadProcessId(consoleWnd, &dwProcessId);
if (GetCurrentProcessId() == dwProcessId)
{
// Sourcetrail has not been started from console and thus has it's own console
ShowWindow(consoleWnd, SW_HIDE);
}
#endif
QtApplication qtApp(argc, argv);