3月122015
ListView列表视图框中焦点的鼠标事件
;ListView列表视图框中焦点的鼠标事件
#include <GuiListView.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') GUICreate("绿色风", 300, 200, -1, -1) $listview = GUICtrlCreateListView("id|url", 5, 5, 290, 190) GUICtrlCreateListViewItem("1|www.baidu.com", $listview) GUICtrlCreateListViewItem("2|www.jianyiit.com", $listview) GUISetState() Do Sleep(10) Until GUIGetMsg() = -3 Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $tNMHDR, $hWndFrom, $iCode $hWndListView = GUICtrlGetHandle($listview) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = DllStructGetData($tNMHDR, 'hWndFrom') $iCode = DllStructGetData($tNMHDR, 'Code') Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CLICK ; 单击 $aHIT = _GUICtrlListView_SubItemHitTest($hWndListView) If _GUICtrlListView_GetItemText($listview, $aHIT[0]) <> "" Then MsgBox(0, "", _GUICtrlListView_GetItemText($listview, $aHIT[0],1)) EndSwitch EndSwitch EndFunc ;==>WM_NOTIFY ```
扫描二维码,在手机上阅读
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!