https://learn.microsoft.com/en-us/windo ... attributes
Code: Select all
Procedure Set_Up_Console()
Define librno.i
Define handle.i
Define hwnd.i
Define csbi.CONSOLE_SCREEN_BUFFER_INFO
Define conoffset.i
Define conlength.i
Define cx, cy
OpenConsole()
librno.i=OpenLibrary(#PB_Any,"kernel32.dll")
hwnd.i=CallFunction(librno.i,"GetConsoleWindow")
CloseLibrary(librno.i)
handle = GetStdHandle_(#STD_OUTPUT_HANDLE)
If handle <> #INVALID_HANDLE_VALUE
If GetConsoleScreenBufferInfo_(handle,@csbi)
If SetConsoleTextAttribute_(handle,#BACKGROUND_BLUE|#BACKGROUND_GREEN|#BACKGROUND_RED)
FillConsoleOutputAttribute_(handle,#BACKGROUND_BLUE|#BACKGROUND_GREEN|#BACKGROUND_RED,csbi\dwSize\x * csbi\dwSize\y,conoffset,@conlength)
EndIf
EndIf
EndIf
cx = GetSystemMetrics_(#SM_CXSCREEN);
cy = GetSystemMetrics_(#SM_CYSCREEN);
SetWindowPos_(hwnd,#Null,-5, 100,#Null,#Null,#SWP_NOSIZE|#SWP_NOZORDER)
ConsoleTitle("Title")
ConsoleColor(3,7)
PrintN("Welcome...")
ConsoleColor(1,7)
PrintN("Console ")
Input()
EndProcedure
Set_Up_Console()