Gui MaximizeBox and Minimize Box, Unexpected Behavior

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Mulsiphix
Posts: 148
Joined: 20 Nov 2015, 17:56

Gui MaximizeBox and Minimize Box, Unexpected Behavior

Post by Mulsiphix » 05 Apr 2022, 13:23

I would like to keep the MinimizeBox and Close buttons for the window, but remove MaximizeBox. It doesn't seem to be working for me though. The Maximize Box is still present. This same behavior works if I apply it to only the MinimizeBox. Is it possible to show one but not the other?

Code: Select all

Gui, -Resize -MaximizeBox +LastFound ; Minimize Box active, Maximize Box greyed out.
; Gui, -Resize -MaximizeBox +MinimizeBox +LastFound ; Same behavior as above line.
; Gui, -Resize -MinimizeBox +MaximizeBox +LastFound ; Maximize Box active, Minimize Box greyed out.
; Gui, -Resize -MinimizeBox +LastFound ; Neither Minimize or Maximize boxes are present. Actually removed, which is what I would like to achieve, but I only wish to remove the Maximize Box.
Gui, Add, Text, , Hello Human!
Gui, Add, Edit, w250 vUser_Specified_Number
Gui, Add, Button, x10 y70 Default,Yes
Gui, Add, Button, x50 y70, No
Gui, Show, , Input Data 
Return

ButtonYes:
ButtonNo:
GuiClose:
GuiEscape:
ExitApp
Documentation for GUI says:
MinimizeBox (present by default): Enables the minimize button in the title bar.

MaximizeBox: Enables the maximize button in the title bar. This is also included as part of Resize below.

Resize: Makes the window resizable and enables its maximize button in the title bar. To avoid enabling the maximize button, specify +Resize -MaximizeBox.
Last edited by Mulsiphix on 05 Apr 2022, 13:40, edited 1 time in total.

RussF
Posts: 1311
Joined: 05 Aug 2021, 06:36

Re: Gui MaximizeBox and Minimize Box, Unexpected Behavior

Post by RussF » 05 Apr 2022, 13:39

Your script works just fine for me. The maximize button is there, but disabled. Note that the docs say that the respective buttons will be "disabled", not removed.

Russ

Mulsiphix
Posts: 148
Joined: 20 Nov 2015, 17:56

Re: Gui MaximizeBox and Minimize Box, Unexpected Behavior

Post by Mulsiphix » 05 Apr 2022, 13:42

RussF wrote:
05 Apr 2022, 13:39
Note that the docs say that the respective buttons will be "disabled", not removed.
Ah, I misinterpreted it :oops:. Any idea if they can be removed, like it occurs when you use the following line:
 

Code: Select all

Gui, -Resize -MinimizeBox +LastFound ; Neither Minimize or Maximize boxes are present. Fully removed.

RussF
Posts: 1311
Joined: 05 Aug 2021, 06:36

Re: Gui MaximizeBox and Minimize Box, Unexpected Behavior

Post by RussF » 05 Apr 2022, 13:50

That's very interesting! Must be a Windows thing.

Code: Select all

Gui, -Resize -MinimizeBox +MaximizeBox +LastFound
also removes the minimize button and shows the maximize. Hmmm :think: , sorry, can't answer that one!

Russ

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Gui MaximizeBox and Minimize Box, Unexpected Behavior

Post by BoBo » 05 Apr 2022, 14:10

You could create your own buttons and remove the whole title bar using the GUI, -caption +border-parameters?

Mulsiphix
Posts: 148
Joined: 20 Nov 2015, 17:56

Re: Gui MaximizeBox and Minimize Box, Unexpected Behavior

Post by Mulsiphix » 05 Apr 2022, 14:25

RussF wrote:
05 Apr 2022, 13:50
That's very interesting! Must be a Windows thing.

Code: Select all

Gui, -Resize -MinimizeBox +MaximizeBox +LastFound
also removes the minimize button and shows the maximize
Yeah, you're probably right about it being a Windows thing. It is actually still there if you look closely. I took an image of it on my computer, then inverted the image. The minimize button was still kind of hard to see, so I adjusted the levels to help make it clearly visible.
 
minimize-still-present.png
minimize-still-present.png (10.93 KiB) Viewed 527 times
 
BoBo wrote:
05 Apr 2022, 14:10
You could create your own buttons and remove the whole title bar using the GUI, -caption +border-parameters?
I'm working on a GUI right now ;)

Post Reply

Return to “Ask for Help (v1)”