From c874768fe8e1737df9aed7f0dc17ea153378f928 Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Mon, 18 Oct 1999 07:47:33 +0000 Subject: [PATCH] *** empty log message *** --- harbour/source/rtl/gt/gtwin.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/harbour/source/rtl/gt/gtwin.c b/harbour/source/rtl/gt/gtwin.c index dba02ffe05..fcac7dbce6 100644 --- a/harbour/source/rtl/gt/gtwin.c +++ b/harbour/source/rtl/gt/gtwin.c @@ -109,7 +109,13 @@ do void hb_gt_Init( void ) { LOG( "Initializing" ); - hb_gtHInput = GetStdHandle( STD_INPUT_HANDLE ); + + if( ( hb_gtHInput = GetStdHandle( STD_INPUT_HANDLE ) ) == INVALID_HANDLE_VALUE ) + { + AllocConsole(); /* It is a Windows app without a console, so we create one */ + hb_gtHInput = GetStdHandle( STD_INPUT_HANDLE ); + } + SetConsoleMode( hb_gtHInput, 0 ); /* ptucker */ HOriginal = HOutput = HCursor = CreateFile( "CONOUT$", /* filename */