|
本帖最后由 9988660000 于 2013-12-9 13:38 编辑
最近一段时间,一直在搜索listbox的双击项目的操作。
搜索了很久,搜索到的大多是listview的双击操作,今天偶然的机会搜到。不敢私存,贡献给大家。
有明白的给注释一下
整理后,如下:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
GUICreate("My GUI list")
$add = GUICtrlCreateButton("Add", 64, 32, 75, 25)
$clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25)
$mylist = GUICtrlCreateList("", 176, 32, 200, 200,BitOR($WS_VSCROLL, $WS_HSCROLL))
GUICtrlSetLimit(-1, 300)
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND");注册一个消息
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $add
GUICtrlSetData($mylist, "You clicked button No1-You clicked button No1|")
Case $clear
GUICtrlSetData($mylist, "")
EndSwitch
WEnd
Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
$iIDFrom = BitAND($wParam, 0xFFFF) ;;这句什么意思?
$iCode = BitShift($wParam, 16) ;;???
Switch $iCode
Case $LBN_DBLCLK ;;双击操作
Switch $iIDFrom
Case $mylist
MsgBox(0,0, "2")
EndSwitch
EndSwitch
EndFunc |
|