2020-07-24 08:07:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "rapps.h"
|
|
|
|
#include "rosui.h"
|
|
|
|
#include "crichedit.h"
|
|
|
|
#include "asyncinet.h"
|
|
|
|
#include "appview.h"
|
|
|
|
#include <shlobj_undoc.h>
|
|
|
|
#include <shlguid_undoc.h>
|
|
|
|
|
|
|
|
#include <atlbase.h>
|
|
|
|
#include <atlcom.h>
|
|
|
|
#include <atltypes.h>
|
|
|
|
#include <atlwin.h>
|
|
|
|
#include <wininet.h>
|
|
|
|
#include <shellutils.h>
|
2021-12-26 01:15:30 +00:00
|
|
|
#include <ui/rosctrls.h>
|
2020-07-24 08:07:43 +00:00
|
|
|
#include <gdiplus.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#define SEARCH_TIMER_ID 'SR'
|
|
|
|
#define TREEVIEW_ICON_SIZE 24
|
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
class CSideTreeView : public CUiWindow<CTreeView>
|
2020-07-24 08:07:43 +00:00
|
|
|
{
|
|
|
|
HIMAGELIST hImageTreeView;
|
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
public:
|
2020-07-24 08:07:43 +00:00
|
|
|
CSideTreeView();
|
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
HTREEITEM
|
|
|
|
AddItem(HTREEITEM hParent, CStringW &Text, INT Image, INT SelectedImage, LPARAM lParam);
|
2020-07-24 08:07:43 +00:00
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
HTREEITEM
|
|
|
|
AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex);
|
2020-07-24 08:07:43 +00:00
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
HIMAGELIST
|
|
|
|
SetImageList();
|
2020-07-24 08:07:43 +00:00
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
VOID
|
|
|
|
DestroyImageList();
|
2020-07-24 08:07:43 +00:00
|
|
|
|
|
|
|
~CSideTreeView();
|
|
|
|
};
|
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
|
2020-07-24 08:07:43 +00:00
|
|
|
{
|
|
|
|
CUiPanel *m_ClientPanel = NULL;
|
|
|
|
CUiSplitPanel *m_VSplitter = NULL;
|
|
|
|
|
|
|
|
CSideTreeView *m_TreeView = NULL;
|
|
|
|
CUiWindow<CStatusBar> *m_StatusBar = NULL;
|
|
|
|
|
|
|
|
CApplicationView *m_ApplicationView = NULL;
|
|
|
|
|
2023-02-28 00:00:29 +00:00
|
|
|
CAppDB *m_Db;
|
|
|
|
CAtlList<CAppInfo *> m_Selected;
|
2020-07-24 08:07:43 +00:00
|
|
|
|
|
|
|
BOOL bUpdating = FALSE;
|
2023-05-21 22:34:02 +00:00
|
|
|
BOOL bAppwizMode;
|
2023-05-21 22:40:56 +00:00
|
|
|
HTREEITEM hRootItemInstalled;
|
2020-07-24 08:07:43 +00:00
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
CStringW szSearchPattern;
|
|
|
|
AppsCategories SelectedEnumType;
|
2020-07-24 08:07:43 +00:00
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
public:
|
2023-05-21 22:34:02 +00:00
|
|
|
explicit CMainWindow(CAppDB *db, BOOL bAppwiz = FALSE);
|
2020-07-24 08:07:43 +00:00
|
|
|
|
|
|
|
~CMainWindow();
|
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
private:
|
|
|
|
VOID
|
|
|
|
InitCategoriesList();
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
CreateStatusBar();
|
|
|
|
BOOL
|
|
|
|
CreateTreeView();
|
|
|
|
BOOL
|
|
|
|
CreateApplicationView();
|
|
|
|
BOOL
|
|
|
|
CreateVSplitter();
|
|
|
|
BOOL
|
|
|
|
CreateLayout();
|
|
|
|
VOID
|
|
|
|
LayoutCleanup();
|
|
|
|
BOOL
|
|
|
|
InitControls();
|
|
|
|
|
|
|
|
VOID
|
|
|
|
OnSize(HWND hwnd, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
RemoveSelectedAppFromRegistry();
|
|
|
|
BOOL
|
|
|
|
UninstallSelectedApp(BOOL bModify);
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId);
|
|
|
|
VOID
|
|
|
|
ShowAboutDlg();
|
|
|
|
VOID
|
|
|
|
OnCommand(WPARAM wParam, LPARAM lParam);
|
|
|
|
VOID
|
|
|
|
UpdateStatusBarText();
|
|
|
|
|
|
|
|
VOID
|
|
|
|
UpdateApplicationsList(AppsCategories EnumType, BOOL bReload = FALSE);
|
|
|
|
VOID
|
2023-02-28 00:00:29 +00:00
|
|
|
AddApplicationsToView(CAtlList<CAppInfo *> &List);
|
2023-02-20 18:30:02 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
static ATL::CWndClassInfo &
|
|
|
|
GetWndClassInfo();
|
|
|
|
|
|
|
|
HWND
|
|
|
|
Create();
|
2020-07-24 08:07:43 +00:00
|
|
|
|
|
|
|
// this function is called when a item of application-view is checked/unchecked
|
|
|
|
// CallbackParam is the param passed to application-view when adding the item (the one getting focus now).
|
2023-02-20 18:30:02 +00:00
|
|
|
VOID
|
|
|
|
ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam);
|
2020-07-24 08:07:43 +00:00
|
|
|
|
|
|
|
// this function is called when application-view is asked to install an application
|
|
|
|
// if Info is not zero, this app should be installed. otherwise those checked apps should be installed
|
2023-02-20 18:30:02 +00:00
|
|
|
BOOL
|
2023-02-28 00:00:29 +00:00
|
|
|
InstallApplication(CAppInfo *Info);
|
2020-07-29 10:50:57 +00:00
|
|
|
|
|
|
|
// this function is called when search text is changed
|
2023-02-20 18:30:02 +00:00
|
|
|
BOOL
|
|
|
|
SearchTextChanged(CStringW &SearchText);
|
2020-07-29 10:50:57 +00:00
|
|
|
|
2023-02-20 18:30:02 +00:00
|
|
|
void
|
|
|
|
HandleTabOrder(int direction);
|
2020-07-24 08:07:43 +00:00
|
|
|
};
|
2023-05-23 20:50:04 +00:00
|
|
|
|
|
|
|
// Main window
|
|
|
|
VOID
|
|
|
|
MainWindowLoop(CMainWindow *wnd, INT nShowCmd);
|