Func _WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $tNMHDR, $iCode, $hMenu
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView;这里改成你的listview的ID
Switch $iCode
Case $NM_DBLCLK
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
$iIndex = DllStructGetData($tInfo, "Index")
If $iIndex >= 0 Then _binzzdup()
EndSwitch
Case $hToolbar;这个是你的toolbar的ID
Switch $iCode
Case $TBN_DROPDOWN
$hMenu = _GUICtrlMenu_CreatePopup()
_GUICtrlMenu_AddMenuItem($hMenu, "菜单项目1", 2000)
_GUICtrlMenu_AddMenuItem($hMenu, "菜单项目2", 2001)
_GUICtrlMenu_AddMenuItem($hMenu, "菜单项目3", 2002)
_GUICtrlMenu_AddMenuItem($hMenu, "", 0)
_GUICtrlMenu_AddMenuItem($hMenu, "菜单项目4", 2003)
_GUICtrlMenu_AddMenuItem($hMenu, "菜单5", 2004)
_GUICtrlMenu_TrackPopupMenu($hMenu, $hGUI)
_GUICtrlMenu_DestroyMenu($hMenu)
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>_WM_NOTIFY
|