Page 1 of 1

Fixed size console window

Posted: Sat Mar 11, 2006 12:11 am
by mouse
Hi,

Just started coding in PB and wondering how I ever did without it! :)

I'm trying to port some ancient software to windows, and the easiest way seems to be to use a graphical console (it uses a lot of PRINT, TAB, INPUT etc). I open the console like this:

Code: Select all

OpenConsole()
EnableGraphicalConsole(1)
Is there any way to make this console window fixed to a particular size so the user can't scroll etc.?

I'm currently using PB 4.00 Beta 5 on a Win XP machine.

Posted: Sat Mar 11, 2006 4:49 am
by mouse
Here's the best solution I've got so far. This results in a titled console window at 80x25 characters that can not be resized to a larger size. Obviously this solution is for a Windows machine only

test.pb

Code: Select all

; open a graphical console
OpenConsole()
EnableGraphicalConsole(1)

; set fore and background to same to hide text output
ConsoleColor(1,1)
ClearConsole()

; sets width, height and window title
RunProgram(".\test.bat","","",#PB_Program_Wait)

; white on blue text
ConsoleColor(15,1)
ClearConsole()

Print("Hit RETURN >")
Input()

CloseConsole()
test.bat

Code: Select all

title My Software Title
mode con lines=25 cols=80
Not an ideal solution but it works! There's probably some Windows function call to do this, but I can't find one.

I can't see any way of changing the font size except for right clicking the title bar.

Posted: Sat Mar 11, 2006 5:14 pm
by Bonne_den_kule

Posted: Sun Mar 12, 2006 7:50 pm
by mouse
Thanks for that,

Works perfectly. Don't know how I managed to miss it though when I searched msdn! :oops: