regedit.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:CodeReader 作者: jasonrbr 项目源码 文件源码
def OnItemRightClick(self, notify_data, extra):
        # First select the item we right-clicked on.
        pt = self.ScreenToClient(win32api.GetCursorPos())
        flags, hItem = self.HitTest(pt)
        if hItem==0 or commctrl.TVHT_ONITEM & flags==0:
            return None
        self.Select(hItem, commctrl.TVGN_CARET)

        menu = win32ui.CreatePopupMenu()
        menu.AppendMenu(win32con.MF_STRING|win32con.MF_ENABLED,1000, "Add Key")
        menu.AppendMenu(win32con.MF_STRING|win32con.MF_ENABLED,1001, "Add Value")
        menu.AppendMenu(win32con.MF_STRING|win32con.MF_ENABLED,1002, "Delete Key")
        self.HookCommand(self.OnAddKey, 1000)
        self.HookCommand(self.OnAddValue, 1001)
        self.HookCommand(self.OnDeleteKey, 1002)
        menu.TrackPopupMenu(win32api.GetCursorPos()) # track at mouse position.
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号