logic: don't hide windows console of foreign process
This commit is contained in:
+9
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user