Page 1 of 1

Console ,ConsoleColor ,caption in graphical mode

Posted: Thu May 09, 2024 9:24 am
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 

Re: Console ,ConsoleColor ,caption in graphical mode

Posted: Fri May 10, 2024 4:18 pm
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.