ReactOS 0.4.15-dev-5829-g6b6a045
procpage.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

INT_PTR CALLBACK ProcessPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
void RefreshProcessPage (void)
 
DWORD GetSelectedProcessId (void)
 
void ProcessPage_OnProperties (void)
 
void ProcessPage_OnOpenFileLocation (void)
 

Variables

HWND hProcessPage
 
HWND hProcessPageListCtrl
 
HWND hProcessPageHeaderCtrl
 
HWND hProcessPageEndProcessButton
 
HWND hProcessPageShowAllProcessesButton
 

Function Documentation

◆ GetSelectedProcessId()

DWORD GetSelectedProcessId ( void  )

Definition at line 103 of file procpage.c.

104{
105 int Index;
106 LVITEM lvitem;
107
109 {
111
112 memset(&lvitem, 0, sizeof(LVITEM));
113
114 lvitem.mask = LVIF_PARAM;
115 lvitem.iItem = Index;
116
118
119 if (lvitem.lParam)
120 return ((LPPROCESS_PAGE_LIST_ITEM)lvitem.lParam)->ProcessId;
121 }
122
123 return 0;
124}
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2711
HWND hProcessPageListCtrl
Definition: procpage.c:43
#define ListView_GetSelectionMark(hwnd)
Definition: commctrl.h:2789
#define ListView_GetSelectedCount(hwndLV)
Definition: commctrl.h:2709
#define LVITEM
Definition: commctrl.h:2375
#define LVIF_PARAM
Definition: commctrl.h:2311
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2394
#define memset(x, y, z)
Definition: compat.h:39
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by DoSetPriority(), ProcessPage_OnDebug(), ProcessPage_OnEndProcess(), ProcessPage_OnEndProcessTree(), ProcessPage_OnOpenFileLocation(), ProcessPage_OnProperties(), ProcessPage_OnSetAffinity(), and ProcessPageOnNotify().

◆ ProcessPage_OnOpenFileLocation()

void ProcessPage_OnOpenFileLocation ( void  )

Definition at line 1235 of file procpage.c.

1236{
1237 DWORD dwProcessId;
1239 LPWSTR pszExePath;
1240 LPWSTR pszCmdLine = NULL;
1241
1242 dwProcessId = GetSelectedProcessId();
1243
1244 /* Retrieve the image path length */
1245 dwLength = GetProcessExecutablePathById(dwProcessId, NULL, 0);
1246 if (dwLength == 0)
1247 return;
1248
1249 /* Allocate and retrieve the image path */
1250 pszExePath = HeapAlloc(GetProcessHeap(), 0, dwLength * sizeof(WCHAR));
1251 if (!pszExePath)
1252 return;
1253
1254 if (GetProcessExecutablePathById(dwProcessId, pszExePath, dwLength) == 0)
1255 goto Cleanup;
1256
1257 /* Build the shell command line */
1258 pszCmdLine = HeapAlloc(GetProcessHeap(), 0, (dwLength + 10) * sizeof(WCHAR));
1259 if (!pszCmdLine)
1260 goto Cleanup;
1261
1262 StringCchPrintfW(pszCmdLine, dwLength + 10, L"/select,\"%s\"", pszExePath);
1263
1264 /* Call the shell to open the file location and select it */
1265 ShellExecuteW(NULL, L"open", L"explorer.exe", pszCmdLine, NULL, SW_SHOWNORMAL);
1266
1267Cleanup:
1268 HeapFree(GetProcessHeap(), 0, pszCmdLine);
1269 HeapFree(GetProcessHeap(), 0, pszExePath);
1270}
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static DWORD DWORD * dwLength
Definition: fusion.c:86
unsigned long DWORD
Definition: ntddk_ex.h:95
#define L(x)
Definition: ntvdm.h:50
static DWORD GetProcessExecutablePathById(_In_ DWORD dwProcessId, _Out_writes_to_opt_(dwLength, return) LPWSTR lpExePath, _In_opt_ DWORD dwLength)
Retrieves the Win32 path of an executable image, by identifier.
Definition: procpage.c:1141
DWORD GetSelectedProcessId(void)
Definition: procpage.c:103
void Cleanup(void)
Definition: procpage.c:66
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2346
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define SW_SHOWNORMAL
Definition: winuser.h:764
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by TaskManagerWndProc().

◆ ProcessPage_OnProperties()

void ProcessPage_OnProperties ( void  )

Definition at line 1196 of file procpage.c.

1197{
1198 DWORD dwProcessId;
1200 LPWSTR pszExePath;
1201 SHELLEXECUTEINFOW info = { 0 };
1202
1203 dwProcessId = GetSelectedProcessId();
1204
1205 /* Retrieve the image path length */
1206 dwLength = GetProcessExecutablePathById(dwProcessId, NULL, 0);
1207 if (dwLength == 0)
1208 return;
1209
1210 /* Allocate and retrieve the image path */
1211 pszExePath = HeapAlloc(GetProcessHeap(), 0, dwLength * sizeof(WCHAR));
1212 if (!pszExePath)
1213 return;
1214
1215 if (GetProcessExecutablePathById(dwProcessId, pszExePath, dwLength) == 0)
1216 goto Cleanup;
1217
1218 /* Call the shell to display the file properties */
1219 info.cbSize = sizeof(SHELLEXECUTEINFOW);
1221 info.hwnd = NULL;
1222 info.lpVerb = L"properties";
1223 info.lpFile = pszExePath;
1224 info.lpParameters = L"";
1225 info.lpDirectory = NULL;
1226 info.nShow = SW_SHOW;
1227 info.hInstApp = NULL;
1228
1230
1231Cleanup:
1232 HeapFree(GetProcessHeap(), 0, pszExePath);
1233}
struct _SHELLEXECUTEINFOW SHELLEXECUTEINFOW
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2335
#define SW_SHOW
Definition: winuser.h:769

Referenced by TaskManagerWndProc().

◆ ProcessPageWndProc()

INT_PTR CALLBACK ProcessPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 136 of file procpage.c.

137{
138 RECT rc;
139 int nXDifference;
140 int nYDifference;
141 int cx, cy;
142
143 switch (message) {
144 case WM_INITDIALOG:
145 /*
146 * Save the width and height
147 */
148 GetClientRect(hDlg, &rc);
151
152 /* Update window position */
154
155 /*
156 * Get handles to the controls
157 */
162
163 /*
164 * Set the title, and extended window styles for the list control
165 */
168
169 AddColumns();
170
171 /*
172 * Subclass the process list control so we can intercept WM_ERASEBKGND
173 */
175
176#ifdef RUN_PROC_PAGE
177 /* Start our refresh thread */
179#endif
180
181 /* Refresh page */
183
184 return TRUE;
185
186 case WM_DESTROY:
187 /* Close the event handle, this will make the */
188 /* refresh thread exit when the wait fails */
189#ifdef RUN_PROC_PAGE
191#endif
193 Cleanup();
194 break;
195
196 case WM_COMMAND:
197 /* Handle the button clicks */
198 switch (LOWORD(wParam))
199 {
200 case IDC_ENDPROCESS:
202 }
203 break;
204
205 case WM_SIZE:
206 if (wParam == SIZE_MINIMIZED)
207 return 0;
208
209 cx = LOWORD(lParam);
210 cy = HIWORD(lParam);
211 nXDifference = cx - nProcessPageWidth;
212 nYDifference = cy - nProcessPageHeight;
215
216 /* Reposition the application page's controls */
218 cx = (rc.right - rc.left) + nXDifference;
219 cy = (rc.bottom - rc.top) + nYDifference;
222
224 MapWindowPoints(hProcessPageEndProcessButton, hDlg, (LPPOINT)(PRECT)(&rc), sizeof(RECT)/sizeof(POINT));
225 cx = rc.left + nXDifference;
226 cy = rc.top + nYDifference;
229
232 cx = rc.left;
233 cy = rc.top + nYDifference;
236 break;
237
238 case WM_NOTIFY:
240 break;
241
242 case WM_KEYDOWN:
243 if (wParam == VK_DELETE)
245 break;
246 }
247
248 return 0;
249}
WNDPROC OldProcessListWndProc
Definition: proclist.c:27
INT_PTR CALLBACK ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: proclist.c:31
#define IDC_ENDPROCESS
Definition: resource.h:36
#define IDC_SHOWALLPROCESSES
Definition: resource.h:41
#define IDC_PROCESSLIST
Definition: resource.h:37
void SaveColumnSettings(void)
Definition: column.c:105
void AddColumns(void)
Definition: column.c:63
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
void ProcessPage_OnEndProcess(void)
Definition: endproc.c:30
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
Definition: procpage.c:472
static DWORD dwProcessThread
Definition: procpage.c:53
HWND hProcessPageEndProcessButton
Definition: procpage.c:45
HWND hProcessPageShowAllProcessesButton
Definition: procpage.c:46
static HANDLE hProcessThread
Definition: procpage.c:52
static int nProcessPageHeight
Definition: procpage.c:50
static int nProcessPageWidth
Definition: procpage.c:49
void ProcessPageUpdate(void)
Definition: procpage.c:126
HWND hProcessPageHeaderCtrl
Definition: procpage.c:44
void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam)
Definition: procpage.c:251
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define ListView_GetHeader(hwnd)
Definition: commctrl.h:2651
#define LVS_EX_HEADERDRAGDROP
Definition: commctrl.h:2733
_Out_opt_ int * cx
Definition: commctrl.h:585
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2725
#define ListView_GetExtendedListViewStyle(hwndLV)
Definition: commctrl.h:2728
#define WM_NOTIFY
Definition: richedit.h:61
Definition: tftpd.h:60
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread)
Definition: taskmgr.c:1181
#define GWLP_WNDPROC
Definition: treelist.c:66
#define HIWORD(l)
Definition: typedefs.h:247
#define SWP_NOACTIVATE
Definition: winuser.h:1232
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_SIZE
Definition: winuser.h:1601
#define SWP_NOMOVE
Definition: winuser.h:1234
#define WM_COMMAND
Definition: winuser.h:1730
#define SWP_NOSIZE
Definition: winuser.h:1235
#define SIZE_MINIMIZED
Definition: winuser.h:2496
#define WM_INITDIALOG
Definition: winuser.h:1729
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SWP_NOOWNERZORDER
Definition: winuser.h:1239
#define VK_DELETE
Definition: winuser.h:2223
#define WM_DESTROY
Definition: winuser.h:1599
#define WM_KEYDOWN
Definition: winuser.h:1705
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
#define SWP_NOZORDER
Definition: winuser.h:1237
#define SetWindowLongPtrW
Definition: winuser.h:5336

Referenced by OnCreate().

◆ RefreshProcessPage()

void RefreshProcessPage ( void  )

Definition at line 463 of file procpage.c.

464{
465#ifdef RUN_PROC_PAGE
466 /* Signal the event so that our refresh thread */
467 /* will wake up and refresh the process page */
469#endif
470}
#define PostThreadMessage
Definition: winuser.h:5823
#define WM_TIMER
Definition: winuser.h:1732

Referenced by OnCreate(), TaskManager_OnOptionsShow16BitTasks(), and TaskManagerWndProc().

Variable Documentation

◆ hProcessPage

HWND hProcessPage
extern

◆ hProcessPageEndProcessButton

HWND hProcessPageEndProcessButton
extern

Definition at line 45 of file procpage.c.

Referenced by ProcessPageUpdate(), and ProcessPageWndProc().

◆ hProcessPageHeaderCtrl

◆ hProcessPageListCtrl

◆ hProcessPageShowAllProcessesButton

HWND hProcessPageShowAllProcessesButton
extern

Definition at line 46 of file procpage.c.

Referenced by ProcessPageWndProc().