Jump to content

how to disable


Recommended Posts

Hey i was wondering is there any way to disable the

Minimize button

Maximize button

By disable i mean just remove them from there ^^

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ยน There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Link to comment
Share on other sites

Helpfile dude, learn to read the helpfile!

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

GUICreate("My GUI", -1, -1, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU))
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Link to comment
Share on other sites

  • Moderators

Helpfile dude, learn to read the helpfile!

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

GUICreate("My GUI", -1, -1, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU))
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
I think he's looking more for something like:
#include <winapi.au3>
$h_gui = GUICreate("my gui")
GUISetState()

$n_timer = TimerInit()
While GUIGetMsg() <> -3
    If $n_timer > 0 And TimerDiff($n_timer) / 1000 >= 3 Then
        _WinRemoveMinMaxBox($h_gui)
        $n_timer = 0
    EndIf
WEnd


Func _WinRemoveMinMaxBox($h_wnd)
    Local Const $GWL__STYLE = -16
    Local Const $WS__MAXIMIZEBOX = 0x0010000
    Local Const $WS__MINIMIZEBOX = 0x0020000
    
    If IsString($h_wnd) Then $h_wnd = WinGetHandle($h_wnd)
    
    Local $a_old_style = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $h_wnd, "int", $GWL__STYLE)
    If @error Then Return SetError(1, 0, 0)
    
    Local $i_style = 0
    If BitAND($a_old_style[0], $WS__MAXIMIZEBOX) Then $i_style = BitOR($i_style, $WS__MAXIMIZEBOX)
    If BitAND($a_old_style[0], $WS__MINIMIZEBOX) Then $i_style = BitOR($i_style, $WS__MINIMIZEBOX)
    
    If Not $i_style Then Return $a_old_style[0]
    
    Local $a_set_window = DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $h_wnd, "int", $GWL__STYLE, "long", $a_old_style[0] - $i_style)
    If @error Then Return SetError(2, 0, 0)
    
    ; Cheap way to refresh the title bar
    WinSetTitle($h_wnd, "", WinGetTitle($h_wnd))
    
    Return $a_set_window[0]
EndFunc
Being able to control it after the GUI is already made.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I think he's looking more for something like:

-snipped-

Being able to control it after the GUI is already made.

It could be, but it's impossible to tell until Cha0sBG learns to be more precise
Link to comment
Share on other sites

  • Moderators

It could be, but it's impossible to tell until Cha0sBG learns to be more precise

True, I probably wasted my time.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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