Function Reference


GUISetStyle

Changes the styles of a GUI window.

GUISetStyle ( Style [, ExStyle [, winhandle]] )

Parameters

style defines the style of the window. See GUI Control Styles Appendix.

Use -1 to leave it unchanged.
exStyle [optional] defines the extended style of the window. See the Extended Style Table. -1 is the default.
Use -1 to leave it unchanged.
winhandle [optional] Windows handle as returned by GUICreate() (default is the previously used window).

Return Value

Success: 1.
Failure: 0.

Remarks

No checking is done on style value, neither non interaction with already defined control. It is the designer responsibility to take care of this compatibility.

Related

GUIGetStyle

Example

#include <GUIConstantsEx.au3>
#include <WindowsStylesConstants.au3>

Example()

Func Example()

    GUICreate("Gui Style", 260, 100)
    Local $idButton = GUICtrlCreateButton("Set Style", 45, 50, 150, 20)
    GUISetState(@SW_SHOW)

    Local $bNewStyle = False, $idMsg
    While 1
        $idMsg = GUIGetMsg()
        Switch $idMsg
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $idButton
                If Not $bNewStyle Then
                    GUISetStyle(BitOR($WS_CAPTION, $WS_POPUPWINDOW, $WS_THICKFRAME), BitOR($WS_EX_CLIENTEDGE, $WS_EX_TOOLWINDOW))
                    GUICtrlSetData($idButton, 'Undo Style')
                    $bNewStyle = True
                Else
                    GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU), 0)
                    GUICtrlSetData($idButton, 'Set Style')
                    $bNewStyle = False
                EndIf
        EndSwitch
    WEnd

    GUIDelete()
EndFunc   ;==>Example