ReactOS  0.4.12-dev-75-g00dd17e
anonymous_namespace{settingsdlg.cpp} Namespace Reference

Functions

BOOL IsCheckedDlgItem (HWND hDlg, INT nIDDlgItem)
 
VOID InitSettingsControls (HWND hDlg, PSETTINGS_INFO Info)
 
INT_PTR CALLBACK SettingsDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ InitSettingsControls()

VOID anonymous_namespace{settingsdlg.cpp}::InitSettingsControls ( HWND  hDlg,
PSETTINGS_INFO  Info 
)

Definition at line 60 of file settingsdlg.cpp.

Referenced by SettingsDlgProc().

61  {
66 
68  Info->szDownloadDir);
69 
71 
72  if (IDC_PROXY_DEFAULT + Info->Proxy == IDC_USE_PROXY)
73  {
76  }
77 
80  }
BOOL bUpdateAtStart
Definition: winmain.h:8
#define IDC_USE_PROXY
Definition: resource.h:53
#define TRUE
Definition: types.h:120
#define IDC_DOWNLOAD_DIR_EDIT
Definition: resource.h:43
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define IDC_UPDATE_AVLIST
Definition: resource.h:42
WCHAR szDownloadDir[MAX_PATH]
Definition: winmain.h:10
#define IDC_LOG_ENABLED
Definition: resource.h:45
#define IDC_PROXY_DEFAULT
Definition: resource.h:51
#define IDC_DEL_AFTER_INSTALL
Definition: resource.h:44
#define BM_SETCHECK
Definition: winuser.h:1882
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_NO_PROXY_FOR
Definition: resource.h:55
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
WCHAR szProxyServer[MAX_PATH]
Definition: winmain.h:20
BOOL bLogEnabled
Definition: winmain.h:9
#define IDC_SAVE_WINDOW_POS
Definition: resource.h:41
BOOL bDelInstaller
Definition: winmain.h:11
#define IDC_PROXY_SERVER
Definition: resource.h:54
BOOL bSaveWndPos
Definition: winmain.h:7
WCHAR szNoProxyFor[MAX_PATH]
Definition: winmain.h:21
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)

◆ IsCheckedDlgItem()

BOOL anonymous_namespace{settingsdlg.cpp}::IsCheckedDlgItem ( HWND  hDlg,
INT  nIDDlgItem 
)
inline

Definition at line 55 of file settingsdlg.cpp.

Referenced by SettingsDlgProc().

56  {
57  return (SendDlgItemMessageW(hDlg, nIDDlgItem, BM_GETCHECK, 0, 0) == BST_CHECKED) ? TRUE : FALSE;
58  }
#define TRUE
Definition: types.h:120
_In_ int nIDDlgItem
Definition: winuser.h:4488
#define BM_GETCHECK
Definition: winuser.h:1879
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197

◆ SettingsDlgProc()

INT_PTR CALLBACK anonymous_namespace{settingsdlg.cpp}::SettingsDlgProc ( HWND  hDlg,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 82 of file settingsdlg.cpp.

Referenced by CreateSettingsDlg().

83  {
84  switch (Msg)
85  {
86  case WM_INITDIALOG:
87  {
90  }
91  break;
92 
93  case WM_COMMAND:
94  {
95  switch (LOWORD(wParam))
96  {
97  case IDC_CHOOSE:
98  ChooseFolder(hDlg);
99  break;
100 
101  case IDC_SAVE_WINDOW_POS:
103  break;
104 
105  case IDC_UPDATE_AVLIST:
107  break;
108 
109  case IDC_LOG_ENABLED:
111  break;
112 
115  break;
116 
117  case IDC_PROXY_DEFAULT:
121  break;
122 
123  case IDC_NO_PROXY:
127  break;
128 
129  case IDC_USE_PROXY:
133  break;
134 
138  break;
139 
140  case IDOK:
141  {
142  ATL::CStringW szDir;
143  ATL::CStringW szProxy;
144  ATL::CStringW szNoProxy;
145  DWORD dwAttr;
146 
148  szDir.GetBuffer(MAX_PATH), MAX_PATH);
149  szDir.ReleaseBuffer();
150 
152  szProxy.GetBuffer(MAX_PATH), MAX_PATH);
153  szProxy.ReleaseBuffer();
156  szProxy.GetString(),
157  szProxy.GetLength() + 1);
158 
160  szNoProxy.GetBuffer(MAX_PATH), MAX_PATH);
161  szNoProxy.ReleaseBuffer();
164  szNoProxy.GetString(),
165  szNoProxy.GetLength() + 1);
166 
167  dwAttr = GetFileAttributesW(szDir.GetString());
168  if (dwAttr != INVALID_FILE_ATTRIBUTES &&
169  (dwAttr & FILE_ATTRIBUTE_DIRECTORY))
170  {
173  szDir.GetString(),
174  szDir.GetLength() + 1);
175  }
176  else
177  {
178  ATL::CStringW szMsgText;
179  szMsgText.LoadStringW(IDS_CHOOSE_FOLDER_ERROR);
180 
181  if (MessageBoxW(hDlg, szMsgText.GetString(), NULL, MB_YESNO) == IDYES)
182  {
183  if (CreateDirectoryW(szDir.GetString(), NULL))
184  {
185  EndDialog(hDlg, LOWORD(wParam));
186  }
187  }
188  else
189  {
191  break;
192  }
193  }
194 
196  SaveSettings(GetParent(hDlg));
197  EndDialog(hDlg, LOWORD(wParam));
198  }
199  break;
200 
201  case IDCANCEL:
202  EndDialog(hDlg, LOWORD(wParam));
203  break;
204  }
205  }
206  break;
207  }
208 
209  return FALSE;
210  }
int GetLength() const
Definition: atlsimpstr.h:356
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
BOOL bUpdateAtStart
Definition: winmain.h:8
#define IDC_USE_PROXY
Definition: resource.h:53
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDYES
Definition: winuser.h:829
#define _countof(array)
Definition: fontsub.cpp:30
#define IDC_DOWNLOAD_DIR_EDIT
Definition: resource.h:43
HWND WINAPI SetFocus(_In_opt_ HWND)
SETTINGS_INFO NewSettingsInfo
Definition: settingsdlg.cpp:11
#define IDC_UPDATE_AVLIST
Definition: resource.h:42
#define IDS_CHOOSE_FOLDER_ERROR
Definition: resource.h:99
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
struct @1571 Msg[]
WCHAR szDownloadDir[MAX_PATH]
Definition: winmain.h:10
void SaveSettings(void)
Definition: settings.c:113
#define IDC_CHOOSE
Definition: resource.h:46
#define IDC_LOG_ENABLED
Definition: resource.h:45
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
#define MB_YESNO
Definition: winuser.h:811
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
smooth NULL
Definition: ftsmooth.c:416
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:19
#define IDC_PROXY_DEFAULT
Definition: resource.h:51
VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo)
Definition: winmain.cpp:46
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define IDC_DEL_AFTER_INSTALL
Definition: resource.h:44
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL IsCheckedDlgItem(HWND hDlg, INT nIDDlgItem)
Definition: settingsdlg.cpp:55
#define IDC_NO_PROXY_FOR
Definition: resource.h:55
#define IDC_DEFAULT_SETTINGS
Definition: resource.h:47
#define MAX_PATH
Definition: compat.h:26
PCXSTR GetString() const
Definition: atlsimpstr.h:361
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define WM_COMMAND
Definition: winuser.h:1716
VOID InitSettingsControls(HWND hDlg, PSETTINGS_INFO Info)
Definition: settingsdlg.cpp:60
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL ChooseFolder(HWND hwnd)
Definition: settingsdlg.cpp:13
HWND WINAPI GetParent(_In_ HWND)
WCHAR szProxyServer[MAX_PATH]
Definition: winmain.h:20
BOOL bLogEnabled
Definition: winmain.h:9
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1378
#define IDC_SAVE_WINDOW_POS
Definition: resource.h:41
#define IDC_NO_PROXY
Definition: resource.h:52
static void __cdecl CopyChars(_Out_writes_to_(nDestLen, nChars) XCHAR *pchDest, _In_ size_t nDestLen, _In_reads_opt_(nChars) const XCHAR *pchSrc, _In_ int nChars)
Definition: atlsimpstr.h:423
BOOL bDelInstaller
Definition: winmain.h:11
#define IDC_PROXY_SERVER
Definition: resource.h:54
BOOL bSaveWndPos
Definition: winmain.h:7
WCHAR szNoProxyFor[MAX_PATH]
Definition: winmain.h:21
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
#define LOWORD(l)
Definition: pedump.c:82