Process Hacker
toolstatus.h
Go to the documentation of this file.
1 /*
2  * Process Hacker ToolStatus -
3  * toolstatus header
4  *
5  * Copyright (C) 2011-2015 dmex
6  * Copyright (C) 2010-2013 wj32
7  *
8  * This file is part of Process Hacker.
9  *
10  * Process Hacker is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * Process Hacker is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef _TOOLSTATUS_H
25 #define _TOOLSTATUS_H
26 
27 #pragma comment(lib, "WindowsCodecs.lib")
28 
29 #define CINTERFACE
30 #define COBJMACROS
31 #define INITGUID
32 #include <phdk.h>
33 #include <phappresource.h>
34 #include <windowsx.h>
35 #include <Wincodec.h>
36 #include <toolstatusintf.h>
37 
38 #include "resource.h"
39 
40 #define PLUGIN_NAME TOOLSTATUS_PLUGIN_NAME
41 #define SETTING_NAME_ENABLE_TOOLBAR (PLUGIN_NAME L".EnableToolBar")
42 #define SETTING_NAME_ENABLE_SEARCHBOX (PLUGIN_NAME L".EnableSearchBox")
43 #define SETTING_NAME_ENABLE_STATUSBAR (PLUGIN_NAME L".EnableStatusBar")
44 #define SETTING_NAME_ENABLE_RESOLVEGHOSTWINDOWS (PLUGIN_NAME L".ResolveGhostWindows")
45 #define SETTING_NAME_ENABLE_STATUSMASK (PLUGIN_NAME L".StatusMask")
46 #define SETTING_NAME_TOOLBARDISPLAYSTYLE (PLUGIN_NAME L".ToolbarDisplayStyle")
47 #define SETTING_NAME_SEARCHBOXDISPLAYMODE (PLUGIN_NAME L".SearchBoxDisplayMode")
48 
49 #define MAX_DEFAULT_TOOLBAR_ITEMS 9
50 
51 #define TIDC_FINDWINDOW (WM_APP + 1)
52 #define TIDC_FINDWINDOWTHREAD (WM_APP + 2)
53 #define TIDC_FINDWINDOWKILL (WM_APP + 3)
54 #define ID_SEARCH_CLEAR (WM_APP + 4)
55 
56 #define STATUS_COUNT 12
57 #define STATUS_MINIMUM 0x1
58 #define STATUS_CPUUSAGE 0x1
59 #define STATUS_COMMIT 0x2
60 #define STATUS_PHYSICAL 0x4
61 #define STATUS_NUMBEROFPROCESSES 0x8
62 #define STATUS_NUMBEROFTHREADS 0x10
63 #define STATUS_NUMBEROFHANDLES 0x20
64 #define STATUS_IOREADOTHER 0x40
65 #define STATUS_IOWRITE 0x80
66 #define STATUS_MAXCPUPROCESS 0x100
67 #define STATUS_MAXIOPROCESS 0x200
68 #define STATUS_VISIBLEITEMS 0x400
69 #define STATUS_SELECTEDITEMS 0x800
70 #define STATUS_MAXIMUM 0x1000
71 
73 {
78 
80 {
83  //SearchBoxDisplayAutoHide = 2
85 
86 typedef enum _REBAR_BAND_ID
87 {
91 
93 {
99 
100 extern HWND ProcessTreeNewHandle;
101 extern HWND ServiceTreeNewHandle;
102 extern HWND NetworkTreeNewHandle;
103 extern INT SelectedTabIndex;
104 extern BOOLEAN EnableToolBar;
105 extern BOOLEAN EnableSearchBox;
106 extern BOOLEAN EnableStatusBar;
107 extern BOOLEAN ToolbarInitialized;
111 extern ULONG StatusMask;
112 extern ULONG ProcessesUpdatedCount;
113 
114 extern HWND RebarHandle;
115 extern HWND ToolBarHandle;
116 extern HWND SearchboxHandle;
117 extern HWND StatusBarHandle;
118 extern HACCEL AcceleratorTable;
120 
121 extern HIMAGELIST ToolBarImageList;
122 extern TBBUTTON ToolbarButtons[10];
123 extern TBSAVEPARAMSW ToolbarSaveParams;
124 
129 
131  _In_ INT TabIndex
132  );
133 
135  VOID
136  );
137 
139  _In_ PPOINT Point
140  );
141 
143  _In_ UINT BandID,
144  _In_ HWND HwndChild,
145  _In_ UINT cyMinChild,
146  _In_ UINT cxMinChild
147  );
148 
150  _In_ UINT BandID
151  );
152 
153 BOOLEAN RebarBandExists(
154  _In_ UINT BandID
155  );
156 
158  VOID
159  );
160 
162  VOID
163  );
164 
165 PWSTR ToolbarGetText(
166  _In_ INT CommandID
167  );
168 
170  VOID
171  );
172 
173 INT_PTR CALLBACK OptionsDlgProc(
174  _In_ HWND hwndDlg,
175  _In_ UINT uMsg,
176  _In_ WPARAM wParam,
177  _In_ LPARAM lParam
178  );
179 
180 BOOLEAN WordMatchStringRef(
181  _In_ PPH_STRINGREF Text
182  );
183 
185  _In_ PPH_TREENEW_NODE Node,
186  _In_opt_ PVOID Context
187  );
189  _In_ PPH_TREENEW_NODE Node,
190  _In_opt_ PVOID Context
191  );
193  _In_ PPH_TREENEW_NODE Node,
194  _In_opt_ PVOID Context
195  );
196 
198  _In_ UINT CmdId
199  );
200 
201 typedef struct _EDIT_CONTEXT
202 {
203  UINT CommandID;
204  INT CXBorder;
205  //INT CYBorder;
209 
211  HFONT WindowFont;
212  HIMAGELIST ImageList;
213 
214  HBRUSH BrushNormal;
215  HBRUSH BrushFocused;
216  HBRUSH BrushHot;
217  HBRUSH BrushFill;
219 
220  BOOLEAN MouseInClient;
222 
223 HBITMAP LoadImageFromResources(
224  _In_ UINT Width,
225  _In_ UINT Height,
226  _In_ PCWSTR Name
227  );
228 
229 #endif