; // Userlib .lib "kernel32.dll" AllocConsole%() GetStdHandle%(nStdHandle%) SetConsoleTitle%(lpConsoleTitle$):"SetConsoleTitleA" SetConsoleTextAttribute%(hConsoleOutput%, wAttributes%) WriteConsole%(hConsoleOutput%, lpBuffer$, nCharToWrite%, lpCharsWritten%, lpReserved%):"WriteConsoleA" CloseHandle%(hObject%) ; // Code Local hConsoleOut%, hConsoleIn% ; // Foreground Attributes Const FORE_BLUE = 1 Const FORE_GREEN = 2 Const FORE_RED = 4 Const FORE_INTENSITY = 8 ; // Background Attributes Const BACK_BLUE = 16 Const BACK_GREEN = 32 Const BACK_RED = 64 Const BACK_INTENSITY = 128 ; // STD Handles Const STD_OUTPUT_HANDLE = -11 Const STD_INPUT_HANDLE = -10 Ret% = AllocConsole() If Ret% = 0 Then Notify "AllocConsole Failed!": End ; // Output hConsoleOut% = GetStdHandle(STD_OUTPUT_HANDLE) If hConsoleOut% = 0 Then Notify "Unable to get STDOUT" ; // Input hConsoleIn% = GetStdHandle(-STD_INPUT_HANDLE) If hConsoleIn% = 0 Then Notify "Unable to get STDIN" Ret% = SetConsoleTitle("My Console App") If Ret% = 0 Then Notify "SetConsoleTitle Failed!" Con_Color% = FORE_RED Or FORE_GREEN Or FORE_BLUE Or FORE_INTENSITY ; Bright White (15) Ret% = SetConsoleTextAttribute(hConsoleOut%, Con_Colo%) If Ret% = 0 Then Notify "SetConsoleTextAttribute Failed!" CloseHandle hConsoleOut% CloseHandle hConsoleIn%