返回一个 GUI 窗口所使用的样式.
GUIGetStyle ( [ 窗口句柄] )
窗口句柄 | [可选参数] 由 GUICreate 返回的窗口句柄或者其他函数得到的窗口句柄(默认使用上一次使用的窗口). |
成功: | 返回一个包含下列信息的二维数组: |
$array[0] = 样式 | |
$array[1] = 扩展样式 | |
失败: | 返回 0. |
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
Local $NewStyle = False, $hWnd, $Style, $GuiStyles, $Msg
$hWnd = GUICreate("Gui Style", 260, 100)
$Style = GUICtrlCreateButton("Set Style", 45, 50, 150, 20)
$GuiStyles = GUIGetStyle($hWnd) ; be careful the style change after opening
GUISetState()
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $Style
If Not $NewStyle Then
GUISetStyle(BitOR($WS_POPUPWINDOW, $WS_THICKFRAME), BitOR($WS_EX_CLIENTEDGE, $WS_EX_TOOLWINDOW))
GUICtrlSetData($Style, 'Undo Style')
$NewStyle = True
Else
GUISetStyle($GuiStyles[0], $GuiStyles[1])
GUICtrlSetData($Style, 'Set Style')
$NewStyle = False
EndIf
Case Else
EndSwitch
WEnd
EndFunc ;==>Example