检索控件的回叫掩码
#Include <GuiListView.au3>
_GUICtrlListView_GetCallbackMask($hWnd)
$hWnd | 控件句柄 |
返回一个回调掩码值.表明项目存储在应用程序的状态或图像数据此值可以是下列各项的任意组合: | |
1 - 项目被标记为剪切和粘贴操作 | |
2 - 项目作为拖放目标高亮显示 | |
4 - 项目具有焦点 | |
8 - 项目被选中 | |
16 - 应用程序保存当前覆盖图像的图像列表索引 | |
32 - 应用程序保存目前状态图像的图像列表索引 |
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
$Debug_LV = False ; 检查传递给 ListView 函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
Example_UDF_Created()
Func Example_UDF_Created()
Local $GUI, $hImage, $hListView
$GUI = GUICreate("(UDF Created) ListView Get CallBack Mask", 400, 300)
$hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 394, 268)
GUISetState()
_GUICtrlListView_SetCallBackMask($hListView, 32)
MsgBox(4160, "信息", "CallBackMask: " & _GUICtrlListView_GetCallbackMask($hListView))
; 加载图像
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xC0C0C0, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF00FF, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFFFF00, 16, 16))
_GUICtrlListView_SetImageList($hListView, $hImage, 1)
_GUICtrlListView_SetImageList($hListView, $hImage, 2)
; 添加列
_GUICtrlListView_AddColumn($hListView, "Column 1", 100)
_GUICtrlListView_AddColumn($hListView, "Column 2", 100)
_GUICtrlListView_AddColumn($hListView, "Column 3", 100)
; 添加项目 with callback for item text
_GUICtrlListView_AddItem($hListView, -1, 0)
_GUICtrlListView_AddItem($hListView, -1, 1)
_GUICtrlListView_AddItem($hListView, -1, 2)
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example_UDF_Created