ReactOS 0.4.16-dev-340-g0540c21
toolspage.c File Reference
#include "precomp.h"
#include <shlwapi.h>
Include dependency graph for toolspage.c:

Go to the source code of this file.

Functions

void AddItem (DWORD, DWORD, DWORD, DWORD, int)
 
void FillListView (void)
 
INT_PTR CALLBACK ToolsPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 

Variables

HWND hToolsPage
 
HWND hToolsListCtrl
 
HWND hToolsDialog
 
DWORD ListItems_Cmds [20]
 
DWORD ListItems_Params [20]
 
DWORD ListItems_Locations [20]
 

Function Documentation

◆ AddItem()

void AddItem ( DWORD  name_id,
DWORD  descr_id,
DWORD  cmd_id,
DWORD  param_id,
int  csidl 
)

Definition at line 25 of file toolspage.c.

25 {
26 TCHAR szTemp[256];
28
29 LoadString(hInst, name_id, szTemp, 256);
30 memset(&item, 0, sizeof(LV_ITEM));
31 item.mask = LVIF_TEXT;
32 item.iImage = 0;
33 item.pszText = szTemp;
35 item.lParam = 0;
37
38 ListItems_Cmds[item.iItem] = cmd_id;
39 ListItems_Params[item.iItem] = param_id;
40 ListItems_Locations[item.iItem] = csidl;
41
42 LoadString(hInst, descr_id, szTemp, 256);
43 item.pszText = szTemp;
44 item.iSubItem = 1;
46}
HINSTANCE hInst
Definition: dxdiag.c:13
static ATOM item
Definition: dde.c:856
#define LVM_SETITEMTEXT
Definition: commctrl.h:2694
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2413
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2312
#define LV_ITEM
Definition: commctrl.h:2342
#define LVIF_TEXT
Definition: commctrl.h:2314
#define memset(x, y, z)
Definition: compat.h:39
DWORD ListItems_Cmds[20]
Definition: toolspage.c:21
DWORD ListItems_Params[20]
Definition: toolspage.c:22
HWND hToolsListCtrl
Definition: toolspage.c:15
DWORD ListItems_Locations[20]
Definition: toolspage.c:23
LONG_PTR LPARAM
Definition: windef.h:208
#define SendMessage
Definition: winuser.h:5855
#define LoadString
Definition: winuser.h:5831
char TCHAR
Definition: xmlstorage.h:189

◆ FillListView()

void FillListView ( void  )

Definition at line 48 of file toolspage.c.

48 {
53}
#define IDS_TOOLS_CMD_NAME
Definition: resource.h:89
#define IDS_TOOLS_REGEDIT_DESCR
Definition: resource.h:100
#define IDS_TOOLS_INFO_DESCR
Definition: resource.h:95
#define IDS_TOOLS_INFO_PARAM
Definition: resource.h:97
#define IDS_TOOLS_SYSDM_PARAM
Definition: resource.h:107
#define IDS_TOOLS_CMD_CMD
Definition: resource.h:91
#define IDS_TOOLS_SYSDM_CMD
Definition: resource.h:106
#define IDS_TOOLS_CMD_PARAM
Definition: resource.h:92
#define IDS_TOOLS_REGEDIT_NAME
Definition: resource.h:99
#define IDS_TOOLS_CMD_DESCR
Definition: resource.h:90
#define IDS_TOOLS_INFO_NAME
Definition: resource.h:94
#define IDS_TOOLS_REGEDIT_PARAM
Definition: resource.h:102
#define IDS_TOOLS_REGEDIT_CMD
Definition: resource.h:101
#define IDS_TOOLS_SYSDM_DESCR
Definition: resource.h:105
#define IDS_TOOLS_INFO_CMD
Definition: resource.h:96
#define IDS_TOOLS_SYSDM_NAME
Definition: resource.h:104
#define CSIDL_SYSTEM
Definition: shlobj.h:2209
#define CSIDL_WINDOWS
Definition: shlobj.h:2208
#define AddItem
Definition: userenv.h:209

Referenced by ToolsPageWndProc().

◆ ToolsPageWndProc()

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

Definition at line 56 of file toolspage.c.

57{
59 TCHAR szTemp[MAX_PATH*2];
60 TCHAR szTemp2[256];
61 TCHAR * Ptr = NULL;
62 LPNMITEMACTIVATE lpnmitem;
63 LPNMHDR nmh;
64 DWORD dwStyle;
66 STARTUPINFO si;
67
68 switch (message)
69 {
70 case WM_INITDIALOG:
71 {
73 hToolsDialog = hDlg;
74
76 dwStyle = dwStyle | LVS_EX_FULLROWSELECT;
78
80
81 // Initialize the application page's controls
83
85 column.pszText = szTemp;
86 column.cx = 150;
88
91 column.pszText = szTemp;
92 column.cx = 500;
94
96 return TRUE;
97 }
98 case WM_COMMAND:
99 {
100 switch (LOWORD(wParam))
101 {
102 case IDC_BTN_RUN:
103 {
105 {
107 Ptr = PathAddBackslash(szTemp);
108
109 if (!Ptr)
110 Ptr = szTemp;
111
112 szTemp2[0] = _T('\0');
115 if (_tcslen(szTemp2))
116 {
117 _tcscat(szTemp, _T(" "));
118 _tcscat(Ptr, szTemp2);
119 }
120 ZeroMemory(&si, sizeof(STARTUPINFO));
121 si.cb = sizeof(STARTUPINFO);
122 if (CreateProcess(NULL, szTemp, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
123 {
124 CloseHandle(pi.hThread);
125 CloseHandle(pi.hProcess);
126 }
127 }
128 }
129 }
130 break;
131 }
132 case WM_NOTIFY:
133 {
134 nmh = (LPNMHDR) lParam;
135 if (nmh->hwndFrom == hToolsListCtrl)
136 {
137 switch (nmh->code)
138 {
139 case LVN_ITEMCHANGED:
140 {
141 lpnmitem = (LPNMITEMACTIVATE) lParam;
142 if (lpnmitem->iItem > -1)
143 {
144 LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], szTemp, 256);
145 szTemp2[0] = _T('\0');
146 LoadString(hInst, ListItems_Params[lpnmitem->iItem], szTemp2, 256);
147 _tcscat(szTemp, _T(" "));
148 _tcscat(szTemp, szTemp2);
150 }
151 break;
152 }
153 case NM_DBLCLK:
154 {
155 lpnmitem = (LPNMITEMACTIVATE) lParam;
156 if (lpnmitem->iItem > -1)
157 {
159 Ptr = PathAddBackslash(szTemp);
160
161 if (!Ptr)
162 Ptr = szTemp;
163
164 szTemp2[0] = _T('\0');
165 LoadString(hInst, ListItems_Cmds[lpnmitem->iItem], Ptr, 256);
166 LoadString(hInst, ListItems_Params[lpnmitem->iItem], szTemp2, 256);
167 if (_tcslen(szTemp2))
168 {
169 _tcscat(szTemp, _T(" "));
170 _tcscat(Ptr, szTemp2);
171 }
172 ZeroMemory(&si, sizeof(STARTUPINFO));
173 si.cb = sizeof(STARTUPINFO);
174 if (CreateProcess(NULL, szTemp, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
175 {
176 CloseHandle(pi.hThread);
177 CloseHandle(pi.hProcess);
178 }
179 }
180 break;
181 }
182 }
183 }
184 }
185 break;
186 }
187 return 0;
188}
#define IDS_TOOLS_COLUMN_DESCR
Definition: resource.h:80
#define IDC_TOOLS_LIST
Definition: resource.h:18
#define IDS_TOOLS_COLUMN_NAME
Definition: resource.h:79
#define IDC_BTN_RUN
Definition: resource.h:16
#define IDC_TOOLS_CMDLINE
Definition: resource.h:15
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
#define _tcscat
Definition: tchar.h:622
static refpint_t pi[]
Definition: server.c:96
#define DWORD
Definition: nt_native.h:44
#define LOWORD(l)
Definition: pedump.c:82
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2641
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739
struct tagNMITEMACTIVATE * LPNMITEMACTIVATE
#define ListView_GetSelectionMark(hwnd)
Definition: commctrl.h:2794
#define LVM_GETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2732
#define LVN_ITEMCHANGED
Definition: commctrl.h:3136
#define LVCF_TEXT
Definition: commctrl.h:2593
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2729
#define LV_COLUMN
Definition: commctrl.h:2552
#define WM_NOTIFY
Definition: richedit.h:61
#define SHGetSpecialFolderPath
Definition: shlobj.h:1531
#define PathAddBackslash
Definition: shlwapi.h:809
DWORD cb
Definition: winbase.h:856
Definition: tftpd.h:60
UINT code
Definition: winuser.h:3162
HWND hwndFrom
Definition: winuser.h:3160
HWND hToolsDialog
Definition: toolspage.c:16
void FillListView(void)
Definition: toolspage.c:48
#define _T(x)
Definition: vfdio.h:22
#define CreateProcess
Definition: winbase.h:3783
#define ZeroMemory
Definition: winbase.h:1737
STARTUPINFOA STARTUPINFO
Definition: winbase.h:3744
#define SWP_NOACTIVATE
Definition: winuser.h:1245
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_COMMAND
Definition: winuser.h:1743
#define SWP_NOSIZE
Definition: winuser.h:1248
#define WM_INITDIALOG
Definition: winuser.h:1742
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_SETTEXT
Definition: winuser.h:1620
struct tagNMHDR * LPNMHDR
#define SWP_NOOWNERZORDER
Definition: winuser.h:1252
#define SWP_NOZORDER
Definition: winuser.h:1250
#define SendDlgItemMessage
Definition: winuser.h:5854
#define _tcslen
Definition: xmlstorage.h:198

Referenced by CreatePropSheet(), and OnCreate().

Variable Documentation

◆ hToolsDialog

HWND hToolsDialog

Definition at line 16 of file toolspage.c.

Referenced by ToolsPageWndProc().

◆ hToolsListCtrl

HWND hToolsListCtrl

Definition at line 15 of file toolspage.c.

Referenced by AddItem(), MsConfigWndProc(), and ToolsPageWndProc().

◆ hToolsPage

HWND hToolsPage

Definition at line 14 of file toolspage.c.

Referenced by MsConfig_OnTabWndSelChange(), MsConfigWndProc(), and OnCreate().

◆ ListItems_Cmds

DWORD ListItems_Cmds[20]

Definition at line 21 of file toolspage.c.

Referenced by AddItem(), and ToolsPageWndProc().

◆ ListItems_Locations

DWORD ListItems_Locations[20]

Definition at line 23 of file toolspage.c.

Referenced by AddItem(), and ToolsPageWndProc().

◆ ListItems_Params

DWORD ListItems_Params[20]

Definition at line 22 of file toolspage.c.

Referenced by AddItem(), and ToolsPageWndProc().