检索绘制插入标记的颜色
#Include <GuiToolBar.au3>
_GUICtrlToolbar_GetInsertMarkColor($hWnd)
$hWnd | 控件句柄 |
成功: | 返回插入标记的颜色 |
#include <GuiToolbar.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
$Debug_TB = False ; 检查传递给函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
Global $iMemo
_Main()
Func _Main()
Local $hGUI, $hToolbar, $aMark
Local Enum $idNew = 1000, $idOpen, $idSave, $idHelp
; 创建 GUI
$hGUI = GUICreate("Toolbar", 400, 300)
$hToolbar = _GUICtrlToolbar_Create($hGUI)
$iMemo = GUICtrlCreateEdit("", 2, 36, 396, 262, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 10, 400, 0, "Courier New")
GUISetState()
; 添加标准系统位图
Switch _GUICtrlToolbar_GetBitmapFlags($hToolbar)
Case 0
_GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_SMALL_COLOR)
Case 2
_GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)
EndSwitch
; 添加按钮
_GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW)
_GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN)
_GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE)
_GUICtrlToolbar_AddButtonSep($hToolbar)
_GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP)
; Set insert mark
_GUICtrlToolbar_SetInsertMarkColor($hToolbar, 0xFF0000)
_GUICtrlToolbar_SetInsertMark($hToolbar, 1, 1)
; Show insert mark
$aMark = _GUICtrlToolbar_GetInsertMark($hToolbar)
MemoWrite("Index ........: " & $aMark[0])
MemoWrite("Relationship .: " & $aMark[1])
MemoWrite("Mark color ...: 0x" & Hex(_GUICtrlToolbar_GetInsertMarkColor($hToolbar), 6))
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
; 写入消息到 memo
Func MemoWrite($sMessage = "")
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite