Просмотр исходного кода

Hide command prompt launched by OS.execute

Currently, the console appears when running OS.execute in an exported project,
but not in the editor. This change prevents it from appearing in either.

Only affects console applications.
hoontee 6 лет назад
Родитель
Сommit
4a58c0487a
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      platform/windows/os_windows.cpp

+ 1 - 1
platform/windows/os_windows.cpp

@@ -2586,7 +2586,7 @@ Error OS_Windows::execute(const String &p_path, const List<String> &p_arguments,
 	modstr.resize(cmdline.size());
 	modstr.resize(cmdline.size());
 	for (int i = 0; i < cmdline.size(); i++)
 	for (int i = 0; i < cmdline.size(); i++)
 		modstr.write[i] = cmdline[i];
 		modstr.write[i] = cmdline[i];
-	int ret = CreateProcessW(NULL, modstr.ptrw(), NULL, NULL, 0, NORMAL_PRIORITY_CLASS, NULL, NULL, si_w, &pi.pi);
+	int ret = CreateProcessW(NULL, modstr.ptrw(), NULL, NULL, 0, NORMAL_PRIORITY_CLASS & CREATE_NO_WINDOW, NULL, NULL, si_w, &pi.pi);
 	ERR_FAIL_COND_V(ret == 0, ERR_CANT_FORK);
 	ERR_FAIL_COND_V(ret == 0, ERR_CANT_FORK);
 
 
 	if (p_blocking) {
 	if (p_blocking) {