Functions > GUI >


GUIGetStyle

Obtient les styles d'une GUI.

GUIGetStyle ( [winhandle] )

Paramètre

winhandle [optionnel] Handle retourné par GUICreate() (par défaut, la fenêtre précédemment utilisé ).

Valeur de retour

Succès: Retourne un tableau à deux éléments qui contient les informations sur les styles:
    [0] = Style
    [1] = ExStyle
Échec: Définit @error <> 0.

Remarque

Soyez prudents, les styles changent après GUISetState().

En relation

GUICreate, GUISetStyle

Exemple

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

Example()

Func Example()

    Local $hGUI = GUICreate("Gui Style", 260, 100)
    Local $idBtnStyle = GUICtrlCreateButton("Set Style", 45, 50, 150, 20)

    Local $aGUIStyle = GUIGetStyle($hGUI) ; attention le style change après l'ouverture

    GUISetState(@SW_SHOW)

    Local $bNewStyle = False, $idMsg = GUIGetMsg()
    While $idMsg <> $GUI_EVENT_CLOSE
        If $idMsg = $idBtnStyle Then
            If Not $bNewStyle Then
                GUISetStyle(BitOR($WS_POPUPWINDOW, $WS_THICKFRAME), BitOR($WS_EX_CLIENTEDGE, $WS_EX_TOOLWINDOW))
                GUICtrlSetData($idBtnStyle, 'Undo Style')                
            Else
                GUISetStyle($aGUIStyle[0], $aGUIStyle[1])
                GUICtrlSetData($idBtnStyle, 'Set Style')                
            EndIf
            $bNewStyle = Not $bNewStyle 
        EndIf
        $idMsg = GUIGetMsg()
    WEnd

    GUIDelete($hGUI)
EndFunc   ;==>Example