ReactOS  0.4.12-dev-51-ge94618b
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.

Referenced by CSideTreeView::AddCategory(), CSideTreeView::AddItem(), CDowloadingAppsListView::AddRow(), and FillListView().

25  {
26  TCHAR szTemp[256];
27  LV_ITEM item;
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;
45  SendMessage(hToolsListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
46 }
#define LV_ITEM
Definition: commctrl.h:2307
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
DWORD ListItems_Cmds[20]
Definition: toolspage.c:21
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2378
HWND hToolsListCtrl
Definition: toolspage.c:15
#define LVM_SETITEMTEXT
Definition: commctrl.h:2659
#define LVIF_TEXT
Definition: commctrl.h:2279
LONG_PTR LPARAM
Definition: windef.h:208
DWORD ListItems_Params[20]
Definition: toolspage.c:22
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2277
char TCHAR
Definition: xmlstorage.h:189
HINSTANCE hInst
Definition: dxdiag.c:13
static ATOM item
Definition: dde.c:856
#define SendMessage
Definition: winuser.h:5709
#define memset(x, y, z)
Definition: compat.h:39
#define LoadString
Definition: winuser.h:5685
DWORD ListItems_Locations[20]
Definition: toolspage.c:23

◆ FillListView()

void FillListView ( void  )

Definition at line 48 of file toolspage.c.

Referenced by ToolsPageWndProc().

48  {
53 }
#define IDS_TOOLS_INFO_CMD
Definition: resource.h:96
#define IDS_TOOLS_SYSDM_NAME
Definition: resource.h:104
#define IDS_TOOLS_CMD_DESCR
Definition: resource.h:90
#define IDS_TOOLS_INFO_DESCR
Definition: resource.h:95
#define IDS_TOOLS_REGEDIT_NAME
Definition: resource.h:99
#define IDS_TOOLS_SYSDM_DESCR
Definition: resource.h:105
#define IDS_TOOLS_REGEDIT_DESCR
Definition: resource.h:100
#define IDS_TOOLS_CMD_CMD
Definition: resource.h:91
#define CSIDL_WINDOWS
Definition: shlobj.h:2023
#define IDS_TOOLS_SYSDM_PARAM
Definition: resource.h:107
#define IDS_TOOLS_INFO_PARAM
Definition: resource.h:97
void AddItem(DWORD, DWORD, DWORD, DWORD, int)
Definition: toolspage.c:25
#define IDS_TOOLS_REGEDIT_CMD
Definition: resource.h:101
#define IDS_TOOLS_INFO_NAME
Definition: resource.h:94
#define IDS_TOOLS_CMD_PARAM
Definition: resource.h:92
#define IDS_TOOLS_CMD_NAME
Definition: resource.h:89
#define CSIDL_SYSTEM
Definition: shlobj.h:2024
#define IDS_TOOLS_REGEDIT_PARAM
Definition: resource.h:102
#define IDS_TOOLS_SYSDM_CMD
Definition: resource.h:106

◆ ToolsPageWndProc()

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

Definition at line 56 of file toolspage.c.

Referenced by CreatePropSheet(), and OnCreate().

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
82  column.mask = LVCF_TEXT | LVCF_WIDTH;
83 
84  LoadString(hInst, IDS_TOOLS_COLUMN_NAME, szTemp, 256);
85  column.pszText = szTemp;
86  column.cx = 150;
88 
89  column.mask = LVCF_TEXT | LVCF_WIDTH;
91  column.pszText = szTemp;
92  column.cx = 500;
94 
95  FillListView();
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 }
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
#define LVCF_WIDTH
Definition: commctrl.h:2557
#define LVCF_TEXT
Definition: commctrl.h:2558
DWORD ListItems_Cmds[20]
Definition: toolspage.c:21
#define DWORD
Definition: msvc.h:34
#define LV_COLUMN
Definition: commctrl.h:2517
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
#define LVN_ITEMCHANGED
Definition: commctrl.h:3101
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2704
#define ZeroMemory
Definition: winbase.h:1635
#define SendDlgItemMessage
Definition: winuser.h:5708
#define SWP_NOZORDER
Definition: winuser.h:1232
WPARAM wParam
Definition: combotst.c:138
HWND hToolsListCtrl
Definition: toolspage.c:15
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3112
void FillListView(void)
Definition: toolspage.c:48
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2606
LONG_PTR LPARAM
Definition: windef.h:208
#define PathAddBackslash
Definition: shlwapi.h:783
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
DWORD ListItems_Params[20]
Definition: toolspage.c:22
#define WM_SETTEXT
Definition: winuser.h:1599
struct tagNMITEMACTIVATE * LPNMITEMACTIVATE
#define IDC_TOOLS_LIST
Definition: resource.h:18
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
DWORD cb
Definition: winbase.h:796
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_BTN_RUN
Definition: resource.h:16
#define SWP_NOACTIVATE
Definition: winuser.h:1227
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2694
HWND hToolsDialog
Definition: toolspage.c:16
static DWORD pi
Definition: protocol.c:150
#define WM_COMMAND
Definition: winuser.h:1716
HWND hwndFrom
Definition: winuser.h:3110
#define CreateProcess
Definition: winbase.h:3572
#define LVM_GETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2697
#define SWP_NOSIZE
Definition: winuser.h:1230
HINSTANCE hInst
Definition: dxdiag.c:13
#define NM_DBLCLK
Definition: commctrl.h:131
STARTUPINFOA STARTUPINFO
Definition: winbase.h:3533
#define SHGetSpecialFolderPath
Definition: shlobj.h:1432
#define IDS_TOOLS_COLUMN_NAME
Definition: resource.h:79
#define IDC_TOOLS_CMDLINE
Definition: resource.h:15
#define SendMessage
Definition: winuser.h:5709
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
#define ListView_GetSelectionMark(hwnd)
Definition: commctrl.h:2759
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define LoadString
Definition: winuser.h:5685
#define WM_NOTIFY
Definition: richedit.h:61
#define IDS_TOOLS_COLUMN_DESCR
Definition: resource.h:80
#define SWP_NOOWNERZORDER
Definition: winuser.h:1234
DWORD ListItems_Locations[20]
Definition: toolspage.c:23

Variable Documentation

◆ hToolsDialog

HWND hToolsDialog

Definition at line 16 of file toolspage.c.

◆ hToolsListCtrl

HWND hToolsListCtrl

Definition at line 15 of file toolspage.c.

Referenced by MsConfigWndProc().

◆ 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().