Console ,ConsoleColor ,caption in graphical mode

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Enthusiast
Enthusiast
Posts: 553
Joined: Tue Oct 14, 2014 12:09 pm

Console ,ConsoleColor ,caption in graphical mode

Post by loulou2522 »

I want to display the console without borders or scrollbars. When I set up this display, it works, but when I want to display the whole inside area of the console with a blue background, then at the bottom of the screen and to the side appears a black background (see my program which shows the problem). Does anyone have a solution so that I can apply the color I want to the whole inside area of the console?
Thanks in advance

Code: Select all

 Import ""
  GetConsoleWindow()
EndImport

If OpenConsole()
  hWnd = GetConsoleWindow()
    SetWindowLongPtr_(hWnd, #GWL_STYLE, GetWindowLongPtr_(hWnd, #GWL_STYLE) &~ (#WS_SYSMENU|#WS_SIZEBOX|#WS_CAPTION))
  SetWindowPos_(hWnd, #Null, 0, 0, 0, 0, #SWP_NOSIZE|#SWP_NOMOVE|#SWP_FRAMECHANGED);
  EnableGraphicalConsole(1)
  ConsoleColor(15,1)
  ClearConsole()
   ConsoleCursor(0)
  PrintN("")
  PrintN("   Appuyez sur [Entree] pour quitter")
  ConsoleCursor(1)
  Input()  
  CloseConsole()
  EndIf 
PBJim
Enthusiast
Enthusiast
Posts: 296
Joined: Fri Jan 19, 2024 11:56 pm

Re: Console ,ConsoleColor ,caption in graphical mode

Post by PBJim »

loulou2522 wrote: Thu May 09, 2024 9:24 am I want to display the console without borders or scrollbars. When I set up this display, it works, but when I want to display the whole inside area of the console with a blue background, then at the bottom of the screen and to the side appears a black background
Your example seems to work okay for me Loulou, Windows 10 PB 6.00. I've done something similar with control of the borders and buttons in the past. The only problem I found with this, was that for Alt-Enter and then Alt-Enter again, the console redraws with the title bar. I'm told the answer is to use SetWindowPos_() but I wasn't able to find the way to do it.

To remove the vertical scrollbar, I'm not certain but I believe you need to disable the screen buffer, i.e. the history.
Post Reply