From 2b955490795892f702b87247fd5c5f35124b7c1d Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 8 Apr 2011 12:49:38 +0000 Subject: Apply console part of patch [#26044] Windows thumbnails and improved filetype registration submitted by Tom Edwards This patch introduces a switch -con and its longer version --start-console. When giving this on cmd-line you'll get the black console window. The new behaviour is to hide it by default. We'll still see briefly the console at startup and during exit, but that's something that cannot be changed. If you start blender from a cmd.exe, the console will not be hidden. --- source/blender/blenlib/intern/winstuff.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/blenlib/intern/winstuff.c') diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 2f750545223..f39cfe14a75 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -37,6 +37,7 @@ #include #include +#include #include "MEM_guardedalloc.h" #include "BLI_path_util.h" @@ -65,6 +66,14 @@ int BLI_getInstallationDir( char * str ) { return 1; } +int IsConsoleEmpty(void) +{ + CONSOLE_SCREEN_BUFFER_INFO csbi = {0}; + HANDLE hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); + + return GetConsoleScreenBufferInfo(hStdOutput, &csbi) && csbi.dwCursorPosition.X == 0 && csbi.dwCursorPosition.Y == 0; +} + void RegisterBlendExtension_Fail(HKEY root) { printf("failed\n"); -- cgit v1.2.3