mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 04:30:35 +01:00
* better restore console mode for windows
git-svn-id: trunk@6124 -
This commit is contained in:
parent
90c85b198a
commit
118ee9a8ab
@ -695,9 +695,12 @@ end;
|
||||
function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
|
||||
{$ifdef Windows}
|
||||
var
|
||||
mode : word;
|
||||
mode,modebefore : word;
|
||||
{$endif Windows}
|
||||
Begin
|
||||
{$ifdef Windows}
|
||||
GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @modebefore);
|
||||
{$endif Windows}
|
||||
RedirErrorOut:=0; RedirErrorIn:=0; RedirErrorError:=0;
|
||||
ExecuteResult:=0;
|
||||
IOStatus:=0;
|
||||
@ -715,10 +718,10 @@ Begin
|
||||
(RedirErrorIn=0) and (RedirErrorError=0) and
|
||||
(ExecuteResult=0);
|
||||
{$ifdef Windows}
|
||||
// reenable mouse events
|
||||
// restore previous mode
|
||||
GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @mode);
|
||||
mode:=mode or ENABLE_MOUSE_INPUT;
|
||||
SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), mode);
|
||||
//mode:=mode or ENABLE_MOUSE_INPUT;
|
||||
SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), modebefore);
|
||||
{$endif Windows}
|
||||
End;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user