diff --git a/harbour/source/rtl/gt/gtwin.c b/harbour/source/rtl/gt/gtwin.c index 774d79f579..4b7c1d2ca8 100644 --- a/harbour/source/rtl/gt/gtwin.c +++ b/harbour/source/rtl/gt/gtwin.c @@ -75,6 +75,7 @@ void hb_gt_Done(void) CHAR_INFO *pCharInfo; /* buffer to store info from ReadConsoleOutput */ SMALL_RECT srWin; /* source rectangle to read from */ CONSOLE_SCREEN_BUFFER_INFO csbi; + CONSOLE_CURSOR_INFO cci; srWin.Top = srWin.Left = 0; srWin.Bottom = (coBuf.Y = hb_gt_GetScreenHeight()) -1; @@ -90,6 +91,7 @@ void hb_gt_Done(void) coDest, /* upper-left cell to write data to */ &srWin); /* screen buffer rectangle to read from */ + GetConsoleCursorInfo(HCursor, &cci); GetConsoleScreenBufferInfo(HOutput, &csbi); HOutput = HOriginal; SetConsoleScreenBufferSize(HOutput, coBuf); @@ -104,6 +106,7 @@ void hb_gt_Done(void) hb_xfree(pCharInfo); SetConsoleActiveScreenBuffer(HOutput); + SetConsoleCursorInfo(HOutput, &cci); } CloseHandle(HInput); HInput = INVALID_HANDLE_VALUE; diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 48c5aff6f6..239c2eca79 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -98,11 +98,12 @@ void hb_gtInit(void) void hb_gtExit(void) { + while( s_uiDispCount ) + hb_gtDispEnd(); + hb_gt_Done(); /* ptucker */ hb_xfree( _Color ); - while( s_uiDispCount ) - hb_gtDispEnd(); } int hb_gtBox (USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, char* pbyFrame)