Compiling to a fixed size window

Discussions related to the BB4W & BBCSDL interpreters and run-time engines
Post Reply
Ivan
Posts: 4
Joined: Tue 07 May 2019, 16:47

Compiling to a fixed size window

Post by Ivan » Tue 07 May 2019, 17:00

Hi all from a newbie,

Can I have a window that cant' be changed in size?

Regards,

Ivan

svein
Posts: 24
Joined: Tue 03 Apr 2018, 19:34

Re: Compiling to a fixed size window

Post by svein » Wed 08 May 2019, 19:44

From the manual.
Hope this helps you.
Svein

Edit: If you are using BB4W
Fixing the window size
Normally the user can re-size the output window by dragging the side or corner to a new position. However there may be circumstances when you would prefer to fix the window size, and prevent it from being changed by the user. You can do that as follows:
GWL_STYLE = -16
WS_THICKFRAME = &40000
WS_MAXIMIZEBOX = &10000
SYS "GetWindowLong", @hwnd%, GWL_STYLE TO ws%
SYS "SetWindowLong", @hwnd%, GWL_STYLE, ws% AND NOT WS_THICKFRAME \
\ AND NOT WS_MAXIMIZEBOX
MODE 8

If necessary change the MODE 8 to whichever MODE is required, or replace it with a suitable VDU 23,22 command. It is important to execute a MODE or VDU 23 statement after changing the window style.

Ivan
Posts: 4
Joined: Tue 07 May 2019, 16:47

Re: Compiling to a fixed size window

Post by Ivan » Wed 08 May 2019, 20:13

Hi Svein,

Thanks.

Had just found it on page 656 and in the program "Just a spinning BB4W graphic.bbc".

Boiled it down to:

SYS "GetWindowLong", @hwnd%, -16 TO ws%
SYS "SetWindowLong", @hwnd%, -16, ws% AND NOT &40000 AND NOT &10000
MODE 8

or from "Just a spinning BB4W graphic.bbc"

SYS"GetWindowLong",@hwnd%,-16TOW%
SYS"SetWindowLong",@hwnd%,-16,W%AND&FFFAFFFF
VDU23,22,512;512;8,16,16,0

Exactly as you described VDU 23 or MODE 8.

I have just started programming again after 30 years. I had a BBC Model B which I used a lot. Programmed in Basic of course and 6502 assembler. Pascal and Comal.

I'm satisfied with this solution.

I have sniffed to C++ and if I remember correctly the Windows buttons disappeared except close x

Post Reply