shell_view.py 文件源码

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

项目:Email_My_PC 作者: Jackeriss 项目源码 文件源码
def Refresh(self):
        stateMask = commctrl.LVIS_SELECTED | commctrl.LVIS_DROPHILITED
        state = 0
        self.children = []
        # Enumerate and store the child PIDLs
        for cid in self.folder.EnumObjects(self.hwnd, 0):
            self.children.append(cid)

        for row_index, data in enumerate(self.children):
            assert len(data)==1, "expecting just a child PIDL"
            typ, path = data[0].split('\0')
            desc = os.path.exists(path) and "Yes" or "No"
            prop_vals = (path, desc)
            # first col
            data, extras = win32gui_struct.PackLVITEM(
                                        item=row_index,
                                        subItem=0,
                                        text=prop_vals[0],
                                        state=state,
                                        stateMask=stateMask)
            win32gui.SendMessage(self.hwnd_child,
                                 commctrl.LVM_INSERTITEM,
                                 row_index, data)
            # rest of the cols.
            col_index = 1
            for prop_val in prop_vals[1:]:
                data, extras = win32gui_struct.PackLVITEM(
                                            item=row_index,
                                            subItem=col_index,
                                            text=prop_val)

                win32gui.SendMessage(self.hwnd_child,
                                     commctrl.LVM_SETITEM,
                                     0, data)
                col_index += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号