异步线程

void CLogicScanLocalSoft::AsycScanLocalData()
{
    AutoLockT lock(m_doneLock);

    m_bScanDone = false;

    DWORD dwThreadID;

    HANDLE hThread = ::CreateThread(NULL, 0, DoLoadDataThread, this, NULL, &dwThreadID);
    CloseHandle(hThread);
}

创建异步线程

void CLogicScanLocalSoft::RescanLocalData(int iSoftID)
{
    AutoLockT lock(m_doneLock);

    m_bScanDone = false;
    m_iRescanSoftID = iSoftID;

    DWORD dwThreadID;
    HANDLE hThread = ::CreateThread(NULL, 0, DoReLoadDataThread, this, NULL, &dwThreadID);
    CloseHandle(hThread);
}

DWORD WINAPI CLogicScanLocalSoft::DoLoadDataThread(LPVOID pVoid)
{
    CLogicScanLocalSoft* pThis = (CLogicScanLocalSoft*)(pVoid);
    if (pThis)
    {
        pThis->ScanLocalSoftInfo();
    }

    return 0;
}

DWORD WINAPI CLogicScanLocalSoft::DoReLoadDataThread(LPVOID pVoid)
{
    CLogicScanLocalSoft* pThis = (CLogicScanLocalSoft*)(pVoid);
    if (pThis)
    {
        pThis->ScanLocalSoftInfo(true,pThis->GetRescanSoftID());
    }

    return 0;
}

 

struct DesktopLinkData {
    xstring lnk_name_;
    xstring full_exe_path_;
    xstring path_;
    xstring exe_;
    xstring path_icon_;

    bool operator<(const DesktopLinkData & data) const {
        return this->path_ < data.path_;
    }
    bool operator ==(const DesktopLinkData & data) const {
        return (full_exe_path_ == data.full_exe_path_) && \
            (path_ == data.path_) && \
            (lnk_name_ == data.lnk_name_) && \
            (exe_ == data.exe_) && \
            (path_icon_ == data.path_icon_);
    }

    DesktopLinkData()
    {}

    DesktopLinkData(const xstring &lnk_name, const xstring &full_exe_path,
        const xstring &path,
        const xstring &exe) :
        lnk_name_(lnk_name),
        full_exe_path_(full_exe_path)
        , path_(path),
        exe_(exe) {
    }
};
typedef std::vector<DesktopLinkData>  DesktopLinkDatas;

struct UninstallData {
public:
    xstring sub_key_name_;       //< subkey 名称,以便后面删除使用
    xstring display_name_;     //< 显示名称
    xstring uninstall_string_; //< 卸载信息
    xstring display_icon_;     //< 图标信息
    xstring install_location_; //< 安装目录
    xstring display_version_;  //< 显示版本号
    xstring display_publicer_; //< 显示发布者
    xstring install_date_;      //< 安装日期
    DWORD   estimated_size_;   //< 注册表预估大小
    BOOL    support_local_open_; //< 支持本地打开

    BOOL operator<(const UninstallData & data) const {
        return this->display_name_ < data.display_name_;
    }
    BOOL operator ==(const UninstallData & data) const {
        return (display_name_ == data.display_name_) && \
            (uninstall_string_ == data.uninstall_string_) && \
            (display_icon_ == data.display_icon_) && \
            (estimated_size_ == data.estimated_size_);
    }

    UninstallData()
        : estimated_size_(0), support_local_open_(FALSE)
    {}
};
typedef std::vector<UninstallData> UninstallDatas;

struct SofterFileInfo {
    xstring        file_name_;//文件名
    xstring        file_path_; //文件路径
    ULONGLONG   file_size_;
    time_t        file_creation_time_;      //创建时间
    time_t        file_last_access_time_;  //最后访问时间
    time_t        file_last_write_time_;    //最后修改时间
};//卸载信息结构体

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值