Jump to content

Recommended Posts

  • Moderators
Posted (edited)

playlet,

guinness showed how to remove both the Maximize and Minimize buttons here. Any use? :mellow:

M23

Edit: Fixed link!

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

But I haven't found a way to remove the maximise button :mellow:

Ref:

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

You may be thinking of some code posted a long time back by rover which is what I based this function on.

#include <GUIConstantsEX.au3>
   #include <WindowsConstants.au3>
   $hGUI = _GUI_NoIcon("Test Window", 300, 200)
   GUISetState()

   Do
   Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func _GUI_NoIcon($sTitle, $iWidth = -1, $iHeight = -1, $iXpos = -1, $iYpos = -1)
   Local $GCL_HICONSM = -34, $GCL_HICON = -14
   Local $hWnd = GUICreate($sTitle, $iWidth, $iHeight, $iXpos, $iYpos, _
         BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_DLGMODALFRAME)
   Local $hIcon = GetClassLong($hWnd, $GCL_HICON)
   DllCall("User32.dll", "int", "DestroyIcon", "hwnd", $hIcon)
   SetClassLong($hWnd, $GCL_HICON, 0)
   SetClassLong($hWnd, $GCL_HICONSM, 0)
   Return $hWnd
EndFunc   ;<==> _GUI_NoIcon()

George

  Reveal hidden contents
Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

  On 8/24/2011 at 7:35 PM, 'guinness said:

But I haven't found a way to remove the maximise button :mellow:

Ref:

Both example are not working for me on Win7 x64 - always close icon only can be seen!

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Posted

My example was only meant to show the close the button! Therefore it works :mellow:

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

I thought this would work but it didn't!

#include <WindowsConstants.au3>

GUICreate("", 500, 500, -1, -1, BitAND($GUI_SS_DEFAULT_GUI, BitNOT($WS_MAXIMIZEBOX))) ; Idea from MrCreatoR
GUISetState(@SW_SHOW)

While 1
    Sleep(10)
    If GUIGetMsg() = -3 Then
        Exit
    EndIf
WEnd
Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

  On 8/24/2011 at 8:08 PM, 'playlet said:

I found this script below. Can anyone translate this to AutoIt and tell me if it works?

Option Explicit

Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)

Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long) As Long


Private Sub MDIForm_Load()
Dim lngStyle As Long
lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lngStyle = lngStyle And Not (WS_MAXIMIZEBOX)
lngStyle = SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)
End Sub

Ref: http://www.xtremevbtalk.com/showthread.php?t=4495

Here the Autoit version:

#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Test", 250, 250, -1, -1,  BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_TABSTOP))
GUISetState(@SW_SHOW)
Const $GWL_STYLE = -16
$lngStyle = _WinAPI_GetWindowLong($hGUI, $GWL_STYLE)
_WinAPI_SetWindowLong($hGUI, $GWL_STYLE,  BitAND($lngStyle, BitNOT($WS_MAXIMIZEBOX)))

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            ExitLoop
    EndSwitch
WEnd

But it is not working! Is this a bit operation: lngStyle = lngStyle And Not (WS_MAXIMIZEBOX) ?

Btw, BitAND($lngStyle, BitNOT($WS_MAXIMIZEBOX)) = BitXOR($lngStyle, $WS_MAXIMIZEBOX) !

_WinAPI_SetWindowLong($hGUI, $GWL_STYLE, BitXOR($lngStyle, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) is removing Min/Max box only,

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...