Author |
Topic: Maximised window (Read 753 times) |
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
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
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
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.
|
|
Logged
|
|
|
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
Re: Maximised window
« Reply #2 on: Oct 12th, 2014, 2:27pm » |
|
on Oct 12th, 2014, 1:01pm, g4bau wrote: 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
|
|
Logged
|
|
|
|
|