Process Hacker
about.c
Go to the documentation of this file.
1 /*
2  * Process Hacker -
3  * about dialog
4  *
5  * Copyright (C) 2010-2013 wj32
6  *
7  * This file is part of Process Hacker.
8  *
9  * Process Hacker is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * Process Hacker is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #include <phapp.h>
24 #include <phappres.h>
25 #include <symprv.h>
26 
27 static INT_PTR CALLBACK PhpAboutDlgProc(
28  _In_ HWND hwndDlg,
29  _In_ UINT uMsg,
30  _In_ WPARAM wParam,
31  _In_ LPARAM lParam
32  )
33 {
34  switch (uMsg)
35  {
36  case WM_INITDIALOG:
37  {
38  PPH_STRING appName;
39 
40 #if (PHAPP_VERSION_REVISION != 0)
41  appName = PhFormatString(
42  L"Process Hacker %u.%u (r%u)",
46  );
47 #else
48  appName = PhFormatString(
49  L"Process Hacker %u.%u",
52  );
53 #endif
54 
55  SetDlgItemText(hwndDlg, IDC_ABOUT_NAME, appName->Buffer);
56  PhDereferenceObject(appName);
57 
58  SetDlgItemText(hwndDlg, IDC_CREDITS,
59  L" Installer by XhmikosR\n"
60  L"Thanks to:\n"
61  L" dmex\n"
62  L" Donors - thank you for your support!\n"
63  L" <a href=\"http://forum.sysinternals.com\">Sysinternals Forums</a>\n"
64  L" <a href=\"http://www.reactos.org\">ReactOS</a>\n"
65  L"Process Hacker uses the following components:\n"
66  L" <a href=\"http://www.minixml.org\">Mini-XML</a> by Michael Sweet\n"
67  L" <a href=\"http://www.pcre.org\">PCRE</a>\n"
68  L" MD5 code by Jouni Malinen\n"
69  L" SHA1 code by Filip Navara, based on code by Steve Reid\n"
70  L" <a href=\"http://www.famfamfam.com/lab/icons/silk\">Silk icons</a>\n"
71  );
72  }
73  break;
74  case WM_COMMAND:
75  {
76  switch (LOWORD(wParam))
77  {
78  case IDCANCEL:
79  case IDOK:
80  EndDialog(hwndDlg, IDOK);
81  break;
82  case IDC_DIAGNOSTICS:
83  {
84  PPH_STRING diagnosticsString = PhGetDiagnosticsString();
85 
86  PhShowInformationDialog(hwndDlg, diagnosticsString->Buffer);
87  PhDereferenceObject(diagnosticsString);
88  }
89  break;
90  }
91  }
92  break;
93  case WM_NOTIFY:
94  {
95  LPNMHDR header = (LPNMHDR)lParam;
96 
97  switch (header->code)
98  {
99  case NM_CLICK:
100  {
101  switch (header->idFrom)
102  {
103  case IDC_CREDITS:
104  case IDC_LINK_SF:
105  PhShellExecute(hwndDlg, ((PNMLINK)header)->item.szUrl, NULL);
106  break;
107  }
108  }
109  break;
110  }
111  }
112  break;
113  }
114 
115  return FALSE;
116 }
117 
119  _In_ HWND ParentWindowHandle
120  )
121 {
122  DialogBox(
124  MAKEINTRESOURCE(IDD_ABOUT),
125  ParentWindowHandle,
126  PhpAboutDlgProc
127  );
128 }
129 
130 FORCEINLINE ULONG PhpGetObjectTypeObjectCount(
131  _In_ PPH_OBJECT_TYPE ObjectType
132  )
133 {
135 
136  PhGetObjectTypeInformation(ObjectType, &info);
137 
138  return info.NumberOfObjects;
139 }
140 
142  VOID
143  )
144 {
145  PH_STRING_BUILDER stringBuilder;
146 
147  PhInitializeStringBuilder(&stringBuilder, 50);
148 
149  PhAppendFormatStringBuilder(&stringBuilder, L"OBJECT INFORMATION\r\n");
150 
151 #define OBJECT_TYPE_COUNT(Type) PhAppendFormatStringBuilder(&stringBuilder, \
152  L#Type L": %u objects\r\n", PhpGetObjectTypeObjectCount(Type))
153 
154  // ref
156 
157  // basesup
164 
165  // ph
177 
178  return PhFinalStringBuilderString(&stringBuilder);
179 }