Process Hacker
miniinfop.h
Go to the documentation of this file.
1 #ifndef PH_MINIINFOP_H
2 #define PH_MINIINFOP_H
3 
4 // Constants
5 
6 #define MIP_CONTAINER_CLASSNAME L"ProcessHackerMiniInfo"
7 
8 #define MIP_TIMER_PIN_FIRST 1
9 #define MIP_TIMER_PIN_LAST (MIP_TIMER_PIN_FIRST + MaxMiniInfoPinType - 1)
10 
11 #define MIP_MSG_FIRST (WM_APP + 150)
12 #define MIP_MSG_UPDATE (WM_APP + 150)
13 #define MIP_MSG_LAST (WM_APP + 151)
14 
15 #define MIP_UNPIN_CHILD_CONTROL_DELAY 1000
16 #define MIP_UNPIN_HOVER_DELAY 250
17 
18 #define MIP_SEPARATOR_HEIGHT 2
19 #define MIP_PADDING_SIZE 3
20 
21 #define MIP_REFRESH_AUTOMATICALLY_PINNED 0x1
22 #define MIP_REFRESH_AUTOMATICALLY_UNPINNED 0x2
23 #define MIP_REFRESH_AUTOMATICALLY_FLAG(Pinned) \
24  ((Pinned) ? MIP_REFRESH_AUTOMATICALLY_PINNED : MIP_REFRESH_AUTOMATICALLY_UNPINNED)
25 
26 // Misc.
27 
28 #define SET_BUTTON_BITMAP(hwndDlg, Id, Bitmap) \
29  SendMessage(GetDlgItem(hwndDlg, (Id)), BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)(Bitmap))
30 
31 // Dialog procedure
32 
33 LRESULT CALLBACK PhMipContainerWndProc(
34  _In_ HWND hWnd,
35  _In_ UINT uMsg,
36  _In_ WPARAM wParam,
37  _In_ LPARAM lParam
38  );
39 
40 INT_PTR CALLBACK PhMipMiniInfoDialogProc(
41  _In_ HWND hwndDlg,
42  _In_ UINT uMsg,
43  _In_ WPARAM wParam,
44  _In_ LPARAM lParam
45  );
46 
47 // Container event handlers
48 
50  _In_ BOOLEAN Showing,
51  _In_ ULONG State
52  );
53 
55  _In_ ULONG Type,
56  _In_ BOOLEAN Minimized
57  );
58 
60  VOID
61  );
62 
64  _In_ ULONG Edge,
65  _In_ PRECT DragRectangle
66  );
67 
69  VOID
70  );
71 
73  _In_ HDC hdc
74  );
75 
77  _In_ ULONG Id
78  );
79 
80 // Child dialog event handlers
81 
83  VOID
84  );
85 
87  _In_ BOOLEAN Showing,
88  _In_ ULONG State
89  );
90 
92  _In_ ULONG Id,
93  _In_ ULONG Code
94  );
95 
96 BOOLEAN PhMipOnNotify(
97  _In_ NMHDR *Header,
98  _Out_ LRESULT *Result
99  );
100 
101 BOOLEAN PhMipOnCtlColorXxx(
102  _In_ ULONG Message,
103  _In_ HWND hwnd,
104  _In_ HDC hdc,
105  _Out_ HBRUSH *Brush
106  );
107 
108 BOOLEAN PhMipOnDrawItem(
109  _In_ ULONG_PTR Id,
110  _In_ DRAWITEMSTRUCT *DrawItemStruct
111  );
112 
114  _In_ ULONG Message,
115  _In_ ULONG_PTR WParam,
116  _In_ ULONG_PTR LParam
117  );
118 
119 // Framework
120 
122 {
127 
128 BOOLEAN NTAPI PhMipMessageLoopFilter(
129  _In_ PMSG Message,
130  _In_ PVOID Context
131  );
132 
134  _In_opt_ PVOID Parameter,
135  _In_opt_ PVOID Context
136  );
137 
139  _In_ PH_MINIINFO_PIN_TYPE PinType,
140  _In_ LONG PinCount
141  );
142 
144  _In_ PPOINT SourcePoint,
145  _Out_ PPH_RECTANGLE WindowRectangle
146  );
147 
149  VOID
150  );
151 
153  _In_ PPH_MINIINFO_SECTION Template
154  );
155 
157  _In_ PPH_MINIINFO_SECTION Section
158  );
159 
161  _In_ PPH_STRINGREF Name
162  );
163 
165  _In_ PWSTR Name,
166  _In_ ULONG Flags,
167  _In_ PPH_MINIINFO_SECTION_CALLBACK Callback
168  );
169 
171  _In_ PPH_MINIINFO_SECTION Section
172  );
173 
175  _In_ PPH_MINIINFO_SECTION NewSection
176  );
177 
179  _In_ struct _PH_MINIINFO_SECTION *Section,
180  _In_opt_ PPH_STRING Text
181  );
182 
184  _In_ PPH_MINIINFO_SECTION Section
185  );
186 
188  VOID
189  );
190 
192  VOID
193  );
194 
196  VOID
197  );
198 
200  VOID
201  );
202 
204  VOID
205  );
206 
208  _In_ BOOLEAN Pinned
209  );
210 
212  VOID
213  );
214 
216  VOID
217  );
218 
219 LRESULT CALLBACK PhMipSectionControlHookWndProc(
220  _In_ HWND hwnd,
221  _In_ UINT uMsg,
222  _In_ WPARAM wParam,
223  _In_ LPARAM lParam
224  );
225 
226 // List-based section
227 
228 #define MIP_MAX_PROCESS_GROUPS 15
229 #define MIP_SINGLE_COLUMN_ID 0
230 
231 #define MIP_CELL_PADDING 5
232 #define MIP_ICON_PADDING 3
233 #define MIP_INNER_PADDING 3
234 
235 typedef struct _PH_MIP_GROUP_NODE
236 {
237  union
238  {
241  };
245 
248 
250  _In_ PWSTR Name,
251  _In_ ULONG Flags,
252  _In_ PPH_MINIINFO_LIST_SECTION Template
253  );
254 
256  _In_ PWSTR Name,
257  _In_ ULONG Flags,
259  );
260 
262  _In_ PPH_MINIINFO_SECTION Section,
263  _In_ PH_MINIINFO_SECTION_MESSAGE Message,
264  _In_opt_ PVOID Parameter1,
265  _In_opt_ PVOID Parameter2
266  );
267 
268 INT_PTR CALLBACK PhMipListSectionDialogProc(
269  _In_ HWND hwndDlg,
270  _In_ UINT uMsg,
271  _In_ WPARAM wParam,
272  _In_ LPARAM lParam
273  );
274 
276  _In_ PPH_LIST List,
277  _In_opt_ PVOID Context
278  );
279 
281  _In_ PPH_MINIINFO_LIST_SECTION ListSection
282  );
283 
285  _In_ PPH_MINIINFO_LIST_SECTION ListSection
286  );
287 
289  VOID
290  );
291 
292 PPH_MIP_GROUP_NODE PhMipAddGroupNode(
293  _In_ PPH_MINIINFO_LIST_SECTION ListSection,
294  _In_ PPH_PROCESS_GROUP ProcessGroup
295  );
296 
298  _In_ PPH_MIP_GROUP_NODE Node
299  );
300 
302  _In_ HWND hwnd,
303  _In_ PH_TREENEW_MESSAGE Message,
304  _In_opt_ PVOID Parameter1,
305  _In_opt_ PVOID Parameter2,
306  _In_opt_ PVOID Context
307  );
308 
310  _In_ PPH_MINIINFO_LIST_SECTION ListSection,
311  _In_ PPH_MIP_GROUP_NODE Node
312  );
313 
314 PPH_MIP_GROUP_NODE PhMipGetSelectedGroupNode(
315  _In_ PPH_MINIINFO_LIST_SECTION ListSection
316  );
317 
319  _In_ PPH_MINIINFO_LIST_SECTION ListSection,
320  _In_ PPH_TREENEW_CONTEXT_MENU ContextMenu
321  );
322 
324  _In_ PPH_MINIINFO_LIST_SECTION ListSection,
325  _In_ PPH_PROCESS_GROUP ProcessGroup,
326  _In_ ULONG Id
327  );
328 
329 // CPU section
330 
332  _In_ struct _PH_MINIINFO_LIST_SECTION *ListSection,
334  _In_opt_ PVOID Parameter1,
335  _In_opt_ PVOID Parameter2
336  );
337 
339  _In_ const void *elem1,
340  _In_ const void *elem2
341  );
342 
344  _In_ const void *elem1,
345  _In_ const void *elem2
346  );
347 
348 // Commit Charge section
349 
351  _In_ struct _PH_MINIINFO_LIST_SECTION *ListSection,
353  _In_opt_ PVOID Parameter1,
354  _In_opt_ PVOID Parameter2
355  );
356 
358  _In_ const void *elem1,
359  _In_ const void *elem2
360  );
361 
363  _In_ const void *elem1,
364  _In_ const void *elem2
365  );
366 
367 // Physical Memory section
368 
370  _In_ struct _PH_MINIINFO_LIST_SECTION *ListSection,
372  _In_opt_ PVOID Parameter1,
373  _In_opt_ PVOID Parameter2
374  );
375 
377  _In_ const void *elem1,
378  _In_ const void *elem2
379  );
380 
382  _In_ const void *elem1,
383  _In_ const void *elem2
384  );
385 
386 // I/O section
387 
389  _In_ struct _PH_MINIINFO_LIST_SECTION *ListSection,
391  _In_opt_ PVOID Parameter1,
392  _In_opt_ PVOID Parameter2
393  );
394 
396  _In_ const void *elem1,
397  _In_ const void *elem2
398  );
399 
401  _In_ const void *elem1,
402  _In_ const void *elem2
403  );
404 
405 #endif