如题,求VBExploer【就是那个仿资源管理器的程序】的右键修改。
程序原来的右键是调用系统的右键菜单的【空白处调用上面的view菜单】。因为设计的要求,需要帮系统的菜单改为已经设计好的自己的菜单,但是因为程序太过复杂,我找不到显示右键菜单的代码在哪里,只知道对着文件右键和对着空白处右键的代码是在不同地方的。我整个程序就差这个环节了,大虾们一定要帮帮忙啊
程序原来的右键是调用系统的右键菜单的【空白处调用上面的view菜单】。因为设计的要求,需要帮系统的菜单改为已经设计好的自己的菜单,但是因为程序太过复杂,我找不到显示右键菜单的代码在哪里,只知道对着文件右键和对着空白处右键的代码是在不同地方的。我整个程序就差这个环节了,大虾们一定要帮帮忙啊
最新版的那个,就是昨天从http://btmtz.mvps.org/vbexplorer/下载的
在MZTOOLS中全工程搜索mnuView,搜到这处:
mListviewDefs第615行:
Call Form1.PopupMenu(Form1.mnuView, vbPopupMenuLeftButton Or vbPopupMenuRightButton)再一看这个IF块的条件,很明显,当else时,里面的含ShowShellContextMenu那一句就是调用的选中文件(含文件夹)时,右键点击的菜单了 If (lvhti.flags And LVHT_ONITEM) = False Then
' Not on an item, show the view context menu, and cancel the
' notification, hopefully ensuring that the app is out of menu mode
' if the menu is canceled (sometime this doesn't even work...?).
Call Form1.PopupMenu(Form1.mnuView, vbPopupMenuLeftButton Or vbPopupMenuRightButton)
DoLVNotify = 1
Else
' On an item, show the item's shell context menu
' Add the pidl of the right clicked (focused) item as the first element
' in the pidl array, this pidl will take context menu verb precedence.
ReDim Preserve apidlRels(0)
apidlRels(0) = m_colPidlRels(CStr(GetLVItemlParam(hwndLV, lvhti.iItem)))
nItems = 1
' Add the pidls of the rest of any selected items to the pidl array
i = LVI_NOITEM
Do
i = ListView_GetNextItem(hwndLV, i, LVNI_SELECTED)
If (i <> LVI_NOITEM) And (i <> lvhti.iItem) Then
ReDim Preserve apidlRels(nItems)
apidlRels(nItems) = m_colPidlRels(CStr(GetLVItemlParam(hwndLV, i)))
nItems = nItems + 1
End If
Loop Until (i = LVI_NOITEM)
' Convert the ListView client coods back to screen coords and show
' the context menu for the selected item(s). If a menu command is
' not executed, cancel the notification...
Call ClientToScreen(hwndLV, pt)
If (ShowShellContextMenu(hwndLV, m_isfParentFolder, _
nItems, apidlRels(0), pt) = False) Then
DoLVNotify = 1
End If
End If ' (lvhti.flags And LVHT_ONITEM) = False