检索部件的 uFlag
#Include <GuiStatusBar.au3>
_GUICtrlStatusBar_GetTextLengthEx($hwnd, $iPart)
$hWnd | 控件句柄 |
$iPart | 部件 0 基索引 |
返回绘制操作类型. 类型可以是以下值: | |
0 - 绘制文本的边框低于窗口平面 | |
$SBT_NOBORDERS - 绘制无边框文本 | |
$SBT_OWNERDRAW - 由父窗口绘制文本 | |
$SBT_POPOUT - 绘制文本的边框高于窗口平面 | |
$SBT_RTLREADING - 文本反向显示到父窗口 |
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
$Debug_SB = False ; 检查传递给函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
Global $iMemo
_Main()
Func _Main()
Global $hGUI, $iI, $hStatus
Global $aParts[3] = [75, 150, -1]
; 创建 GUI
$hGUI = GUICreate("StatusBar Get Text LengthEx", 400, 300)
$hStatus = _GUICtrlStatusBar_Create($hGUI, $SBT_NOBORDERS)
; 创建 memo 控件
$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; Set parts
_GUICtrlStatusBar_SetParts($hStatus, $aParts)
_GUICtrlStatusBar_SetText($hStatus, "Part 1", 0, $SBT_POPOUT)
_GUICtrlStatusBar_SetText($hStatus, "Part 2", 1, $SBT_NOBORDERS)
_GUICtrlStatusBar_SetText($hStatus, "Part 3", 2, $SBT_NOTABPARSING)
; Get text information
For $iI = 0 To _GUICtrlStatusBar_GetCount($hStatus) - 1
MemoWrite("Part " & $iI & " text flags .: " & _GUICtrlStatusBar_GetTextFlags($hStatus, $iI))
MemoWrite("Part " & $iI & " text length : " & _GUICtrlStatusBar_GetTextLength($hStatus, $iI))
MemoWrite("Part " & $iI & " text length : 0x" & Hex(_GUICtrlStatusBar_GetTextLengthEx($hStatus, $iI)))
MemoWrite()
Next
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
; 写入消息到 memo
Func MemoWrite($sMessage = "")
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite