[RAPPS] listview refactor (#2970)

This makes it easier to maintain the listview, and better separates the application list and listview.

* [RAPPS] fix memory leak when cleanup. some renaming are also done
* [RAPPS] move the code adding apps info inside class CAppsListView
* [RAPPS] add table view, create listview and AppInfoDisplay inside it
* [RAPPS] rename INSTALLED_INFO as CInstalledApplicationInfo
now it corresponds with CAvailableApplicationInfo
* [RAPPS] add CInstalledApps
* [RAPPS] optimize the speed when refreshing listview
* [RAPPS] correctly handle Enum for InstalledApps
* [RAPPS] make check all working properly (this also fixes some bugs)
the old version has some bugs when check all items after switching tags in tree-view
* [RAPPS] add handling for wow64
* [RAPPS] use an inline function to replace INSERT_TEXT macro
* [RAPPS] fix the bug that StatusBar won't update when switching tags
* [RAPPS] now TableView always reset bIsAscending in SetDisplayMode
* [RAPPS] rename TableView to ApplicationView
* [RAPPS] now bIsAscending would be reset when switching column in listview
This commit is contained in:
He Yang 2020-07-21 22:13:39 +08:00 committed by Mark Jansen
parent 4482d0f455
commit 10c0ff7416
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
8 changed files with 1147 additions and 653 deletions

View file

@ -3,19 +3,51 @@
#include <windef.h>
#include <atlstr.h>
struct INSTALLED_INFO
class CInstalledApplicationInfo
{
HKEY hRootKey;
public:
BOOL IsUserKey;
REGSAM WowKey;
HKEY hSubKey;
BOOL bIsUpdate = FALSE;
ATL::CStringW szKeyName;
CInstalledApplicationInfo(BOOL bIsUserKey, REGSAM RegWowKey, HKEY hKey);
BOOL GetApplicationString(LPCWSTR lpKeyName, ATL::CStringW& String);
BOOL UninstallApplication(BOOL bModify);
LSTATUS RemoveFromRegistry();
ATL::CStringW szDisplayName;
ATL::CStringW szDisplayVersion;
ATL::CStringW szPublisher;
ATL::CStringW szRegOwner;
ATL::CStringW szProductID;
ATL::CStringW szHelpLink;
ATL::CStringW szHelpTelephone;
ATL::CStringW szReadme;
ATL::CStringW szContact;
ATL::CStringW szURLUpdateInfo;
ATL::CStringW szURLInfoAbout;
ATL::CStringW szComments;
ATL::CStringW szInstallDate;
ATL::CStringW szInstallLocation;
ATL::CStringW szInstallSource;
ATL::CStringW szUninstallString;
ATL::CStringW szModifyPath;
~CInstalledApplicationInfo();
};
typedef INSTALLED_INFO *PINSTALLED_INFO;
typedef BOOL(CALLBACK *APPENUMPROC)(INT ItemIndex, ATL::CStringW &Name, PINSTALLED_INFO Info, PVOID param);
typedef BOOL(CALLBACK *APPENUMPROC)(CInstalledApplicationInfo * Info, PVOID param);
BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc, PVOID param);
BOOL GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, LPWSTR szString);
class CInstalledApps
{
ATL::CAtlList<CInstalledApplicationInfo *> m_InfoList;
public:
BOOL Enum(INT EnumType, APPENUMPROC lpEnumProc, PVOID param);
VOID FreeCachedEntries();
};
BOOL UninstallApplication(PINSTALLED_INFO ItemInfo, BOOL bModify);