BBC BASIC for Windows
« Maximised window »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:18pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Maximised window  (Read 754 times)
Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Maximised window
« Thread started on: Oct 12th, 2014, 11:24am »

Hi,

I'm trying to permanently and immovably fix the window to its maximum size. The code,

SYS "ShowWindow", @hwnd%, SW_MAXIMIZE
SYS "GetWindowLong", @hwnd%, GWL_STYLE TO ws%
SYS "SetWindowLong", @hwnd%, GWL_STYLE, ws% AND NOT WS_MAXIMIZEBOX

sets up the size and removes the maximise button, but I can still reduce it by double-clicking on the title bar. Is there a way to stop this ability, but still be able to minimise if necessary? I've searched all the window styles, but none of them seem to be applicable.

Matt
User IP Logged

rtr2
Guest
xx Re: Maximised window
« Reply #1 on: Oct 12th, 2014, 1:01pm »

on Oct 12th, 2014, 11:24am, Matt wrote:
Is there a way to stop this ability, but still be able to minimise if necessary?

Did you try Google? A quick search gave several hits stating that the only way is to suppress the WM_NCLBUTTONDBLCLK message:

Code:
      INSTALL @lib$+"SUBCLASS"
      PROC_subclass(WM_NCLBUTTONDBLCLK, FNdummy())
      DEF FNdummy(M%,W%,L%) = FALSE

      SYS "ShowWindow", @hwnd%, SW_MAXIMIZE
      SYS "GetWindowLong", @hwnd%, GWL_STYLE TO ws%
      SYS "SetWindowLong", @hwnd%, GWL_STYLE, ws% AND NOT WS_MAXIMIZEBOX

      REPEAT
        WAIT 1
      UNTIL FALSE 

You could probably argue that being able to double-click on the title bar even when the maximize box is disabled is a bug in Windows, but of course they can't change the behaviour now.

Richard.
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Maximised window
« Reply #2 on: Oct 12th, 2014, 2:27pm »

on Oct 12th, 2014, 1:01pm, g4bau wrote:
Did you try Google?

I didn't. However, even now looking it up specifically, I'm afraid the understanding is a little beyond me at the moment. Hopefully, the more I learn...

The code you supplied works fine in my program, thank you. Until I get time to examine the principals within it more closely, I will use the appropriate lines 'as is'.

Thanks again.

Matt
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls