2a8a942e0a548c708717cc4ef3baf846fd8974c6
[reactos.git] / reactos / base / applications / mscutils / devmgmt_new / DeviceView.h
1 #pragma once
2 #include "Devices.h"
3
4 enum ListDevices
5 {
6 DevicesByType,
7 DevicesByConnection,
8 ResourcesByType,
9 ResourcesByConnection
10 };
11
12 class CDeviceView : public CDevices
13 {
14 CDevices *m_Devices;
15 HWND m_hMainWnd;
16 HWND m_hTreeView;
17 HWND m_hPropertyDialog;
18 HMENU m_hShortcutMenu;
19 ListDevices m_ListDevices;
20
21 HIMAGELIST m_ImageList;
22 HTREEITEM m_hTreeRoot;
23
24 BOOL m_ShowHidden;
25
26 public:
27 CDeviceView(
28 HWND hMainWnd,
29 ListDevices List
30 );
31
32 ~CDeviceView(void);
33
34 BOOL Initialize();
35 BOOL Uninitialize();
36
37 VOID EnableContextMenuItem(
38 _In_ UINT Id,
39 _In_ UINT Enabled
40 );
41
42 VOID ShowContextMenu(
43 _In_ INT xPos,
44 _In_ INT yPos
45 );
46
47 VOID Size(
48 _In_ INT x,
49 _In_ INT y,
50 _In_ INT cx,
51 _In_ INT cy
52 );
53
54 VOID Refresh();
55 VOID DisplayPropertySheet();
56 VOID SetFocus();
57
58 BOOL IsRootItemSelected();
59
60 BOOL IsRootItem(
61 _In_ HTREEITEM Item
62 );
63
64 BOOL HasChildItem(
65 _In_ HTREEITEM Item
66 );
67
68 VOID SetDeviceListType(ListDevices List)
69 {
70 m_ListDevices = List;
71 }
72
73 ListDevices GetDeviceListType()
74 {
75 return m_ListDevices;
76 }
77
78 VOID ShowHiddenDevices(_In_ BOOL ShowHidden)
79 {
80 m_ShowHidden = ShowHidden;
81 }
82
83 private:
84 static unsigned int __stdcall ListDevicesThread(
85 void *Param
86 );
87
88 BOOL ListDevicesByConnection(
89 );
90 BOOL ListDevicesByType(
91 );
92
93 VOID RecurseChildDevices(
94 _In_ DEVINST ParentDevice,
95 _In_ HTREEITEM hParentTreeItem
96 );
97
98 HTREEITEM InsertIntoTreeView(
99 _In_ HTREEITEM hParent,
100 _In_z_ LPWSTR lpLabel,
101 _In_ LPARAM lParam,
102 _In_ INT DevImage,
103 _In_ UINT OverlayImage
104 );
105
106 VOID RecurseDeviceView(
107 _In_ HTREEITEM hParentItem
108 );
109
110 VOID EmptyDeviceView(
111 );
112 };
113