IsConsole: Boolean; { True if compiled as console app }
function ConsoleIs: Boolean; begin Result:=GetStdHandle(STD_OUTPUT_HANDLE)<>0; end;