forked from zodiacon/ObjectExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainFrm.h
108 lines (98 loc) · 5.19 KB
/
MainFrm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include "OwnerDrawnMenu.h"
#include "Interfaces.h"
#include "CustomTabView.h"
#include <Theme.h>
#include "SymbolManager.h"
class CMainFrame :
public CFrameWindowImpl<CMainFrame>,
public CAutoUpdateUI<CMainFrame>,
public COwnerDrawnMenu<CMainFrame>,
public IMainFrame,
public CMessageFilter,
public CIdleHandler {
public:
DECLARE_FRAME_WND_CLASS(L"ObjectExplorerMainWnd", IDR_MAINFRAME)
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual BOOL OnIdle();
protected:
BEGIN_MSG_MAP(CMainFrame)
MESSAGE_HANDLER(WM_TIMER, OnTimer)
NOTIFY_CODE_HANDLER(TBVN_PAGEACTIVATED, OnPageActivated)
if (uMsg == WM_COMMAND && m_view.GetPageCount() > 0) {
auto view = (IView*)m_view.GetPageData(m_view.GetActivePage());
bHandled = view->ProcessCommand((UINT)wParam);
if (bHandled)
return TRUE;
}
COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit)
COMMAND_ID_HANDLER(ID_OBJECTS_OBJECTTYPES, OnObjectTypes)
COMMAND_ID_HANDLER(ID_SYSTEM_ZOMBIEPROCESSES, OnZombieProcesses)
COMMAND_ID_HANDLER(ID_SYSTEM_ZOMBIETHREADS, OnZombieThreads)
COMMAND_ID_HANDLER(ID_OBJECTS_OBJECTMANAGERNAMESPACE, OnObjectManager)
COMMAND_ID_HANDLER(ID_OBJECTS_ALLHANDLES, OnAllHandles)
COMMAND_ID_HANDLER(ID_OBJECTS_ALLOBJECTS, OnAllObjects)
COMMAND_ID_HANDLER(ID_OBJECTS_HANDLESINPROCESS, OnHandlesInProcess)
COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar)
COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
COMMAND_ID_HANDLER(ID_WINDOW_CLOSE, OnWindowClose)
COMMAND_ID_HANDLER(ID_FILE_RUNASADMINISTRATOR, OnRunAsAdmin)
COMMAND_ID_HANDLER(ID_WINDOW_CLOSE_ALL, OnWindowCloseAll)
COMMAND_RANGE_HANDLER(ID_WINDOW_TABFIRST, ID_WINDOW_TABLAST, OnWindowActivate)
COMMAND_ID_HANDLER(ID_HELP_ABOUTWINDOWS, OnAboutWindows)
COMMAND_ID_HANDLER(ID_OPTIONS_ALWAYSONTOP, OnAlwaysOnTop)
COMMAND_ID_HANDLER(ID_OPTIONS_DARKMODE, OnDarkMode)
MESSAGE_HANDLER(WM_SHOWWINDOW, OnShowWindow)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
CHAIN_MSG_MAP(CAutoUpdateUI<CMainFrame>)
CHAIN_MSG_MAP(COwnerDrawnMenu<CMainFrame>)
CHAIN_MSG_MAP(CFrameWindowImpl<CMainFrame>)
REFLECT_NOTIFICATIONS_EX()
END_MSG_MAP()
private:
// Inherited via IMainFrame
HWND GetHwnd() const override;
BOOL TrackPopupMenu(HMENU hMenu, DWORD flags, int x, int y) override;
CUpdateUIBase& GetUI() override;
bool AddToolBar(HWND tb) override;
void SetStatusText(int index, PCWSTR text) override;
void ActivatePage(int page);
void InitMenu();
void SetAlwaysOnTop(bool alwaysOnTop);
void InitDarkTheme();
void SetDarkMode(bool dark);
// Handler prototypes (uncomment arguments if needed):
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnTimer(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
LRESULT OnShowWindow(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnObjectTypes(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnObjectManager(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnWindowClose(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnWindowCloseAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnWindowActivate(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnRunAsAdmin(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnPageActivated(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/);
LRESULT OnAllHandles(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) const;
LRESULT OnAllObjects(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) const;
LRESULT OnHandlesInProcess(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnZombieProcesses(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnZombieThreads(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnAboutWindows(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnAlwaysOnTop(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnDarkMode(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
CCustomTabView m_view;
CMultiPaneStatusBarCtrl m_StatusBar;
int m_CurrentPage{ -1 };
Theme m_DefaultTheme{ true }, m_DarkTheme;
};