xref: /reactos/dll/win32/devmgr/devmgmt/MainWindow.h (revision 5cb06151)
1 #pragma once
2 #include "DeviceView.h"
3 
4 typedef struct _MENU_HINT
5 {
6     WORD CmdId;
7     UINT HintId;
8 } MENU_HINT, *PMENU_HINT;
9 
10 class CDeviceManager
11 {
12     CAtlStringW m_szMainWndClass;
13     CDeviceView *m_DeviceView;
14     HWND m_hMainWnd;
15     HWND m_hStatusBar;
16     HWND m_hToolBar;
17     HMENU m_hMenu;
18     int m_CmdShow;
19     BOOL m_RefreshPending;
20 
21 public:
22     CDeviceManager(void);
23     ~CDeviceManager(void);
24 
25     bool Create(
26         _In_ HWND hWndParent,
27         _In_ HINSTANCE hInst,
28         _In_opt_z_ LPCWSTR lpMachineName,
29         _In_ int nCmdShow
30         );
31 
32 private:
33     static LRESULT CALLBACK MainWndProc(
34         HWND hwnd,
35         UINT msg,
36         WPARAM wParam,
37         LPARAM lParam
38         );
39 
40     bool Initialize(
41         _In_z_ LPCTSTR lpCaption,
42         _In_ int nCmdShow
43         );
44 
45     int Run();
46     void Uninitialize(void);
47 
48     LRESULT OnCreate(
49         _In_ HWND hwnd
50         );
51 
52     LRESULT OnDestroy(void);
53     LRESULT OnSize(void);
54 
55     LRESULT OnNotify(
56         _In_ LPARAM lParam
57         );
58 
59     LRESULT OnContext(
60         _In_ LPARAM lParam
61         );
62 
63     LRESULT OnCommand(
64         _In_ WPARAM wParam,
65         LPARAM lParam
66         );
67 
68     void OnActivate(void);
69 
70     bool CreateToolBar(void);
71     bool CreateStatusBar(void);
72 
73     void UpdateToolbar(void);
74 
75     bool StatusBarLoadString(
76         _In_ HWND hStatusBar,
77         _In_ INT PartId,
78         _In_ HINSTANCE hInstance,
79         _In_ UINT uID
80         );
81 
82     void UpdateStatusBar(
83         _In_ bool InMenuLoop
84         );
85 
86     bool MainWndMenuHint(
87         _In_ WORD CmdId,
88         _In_ const MENU_HINT *HintArray,
89         _In_ DWORD HintsCount,
90         _In_ UINT DefHintId
91         );
92 
93     bool RefreshView(
94         _In_ ViewType Type,
95         _In_ bool ScanForChanges
96         );
97 };
98 
99