ReactOS  0.4.15-dev-1386-g5cb9f87
settingsdlg.cpp File Reference
#include "rapps.h"
Include dependency graph for settingsdlg.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{settingsdlg.cpp}
 

Functions

BOOL ChooseFolder (HWND hwnd)
 
BOOL IsUrlValid (const WCHAR *Url)
 
BOOL anonymous_namespace{settingsdlg.cpp}::IsCheckedDlgItem (HWND hDlg, INT nIDDlgItem)
 
VOID anonymous_namespace{settingsdlg.cpp}::InitSettingsControls (HWND hDlg, PSETTINGS_INFO Info)
 
INT_PTR CALLBACK anonymous_namespace{settingsdlg.cpp}::SettingsDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
 
VOID CreateSettingsDlg (HWND hwnd)
 

Variables

SETTINGS_INFO NewSettingsInfo
 

Function Documentation

◆ ChooseFolder()

BOOL ChooseFolder ( HWND  hwnd)

Definition at line 12 of file settingsdlg.cpp.

13 {
14  BOOL bRet = FALSE;
15  BROWSEINFOW bi;
16  ATL::CStringW szChooseFolderText;
17 
18  szChooseFolderText.LoadStringW(IDS_CHOOSE_FOLDER_TEXT);
19 
20  ZeroMemory(&bi, sizeof(bi));
21  bi.hwndOwner = hwnd;
22  bi.pidlRoot = NULL;
23  bi.lpszTitle = szChooseFolderText.GetString();
24  bi.ulFlags = BIF_USENEWUI | BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS | /* BIF_BROWSEFILEJUNCTIONS | */ BIF_VALIDATE;
25 
27  {
28  ATL::CStringW szBuf;
29 
30  LPITEMIDLIST lpItemList = SHBrowseForFolderW(&bi);
31  if (lpItemList && SHGetPathFromIDListW(lpItemList, szBuf.GetBuffer(MAX_PATH)))
32  {
33  szBuf.ReleaseBuffer();
34  if (!szBuf.IsEmpty())
35  {
37  bRet = TRUE;
38  }
39  }
40  else
41  {
42  szBuf.ReleaseBuffer();
43  }
44 
45  CoTaskMemFree(lpItemList);
47  }
48 
49  return bRet;
50 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define TRUE
Definition: types.h:120
#define IDC_DOWNLOAD_DIR_EDIT
Definition: resource.h:45
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1294
HWND hwndOwner
Definition: shlobj.h:1127
#define ZeroMemory
Definition: winbase.h:1648
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
if SUCCEEDED(hr)
#define BIF_DONTGOBELOWDOMAIN
Definition: shlobj.h:1145
#define IDS_CHOOSE_FOLDER_TEXT
Definition: resource.h:103
LPCWSTR lpszTitle
Definition: shlobj.h:1130
#define MAX_PATH
Definition: compat.h:34
PCXSTR GetString() const
Definition: atlsimpstr.h:361
#define BIF_USENEWUI
Definition: shlobj.h:1151
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1128
LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brsfolder.c:1357
bool IsEmpty() const
Definition: atlsimpstr.h:379
UINT ulFlags
Definition: shlobj.h:1131
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1144
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
#define NULL
Definition: types.h:112
#define BIF_VALIDATE
Definition: shlobj.h:1149
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by anonymous_namespace{settingsdlg.cpp}::SettingsDlgProc().

◆ CreateSettingsDlg()

VOID CreateSettingsDlg ( HWND  hwnd)

Definition at line 281 of file settingsdlg.cpp.

282 {
285  hwnd,
287 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDD_SETTINGS_DIALOG
Definition: resource.h:63
INT_PTR CALLBACK SettingsDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4374
HINSTANCE hInst
Definition: dxdiag.c:13
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CMainWindow::OnCommand().

◆ IsUrlValid()

BOOL IsUrlValid ( const WCHAR Url)

Definition at line 52 of file settingsdlg.cpp.

53 {
54  URL_COMPONENTSW UrlComponmentInfo = { 0 };
55  UrlComponmentInfo.dwStructSize = sizeof(UrlComponmentInfo);
56  UrlComponmentInfo.dwSchemeLength = 1;
57 
58  BOOL bSuccess = InternetCrackUrlW(Url, wcslen(Url), 0, &UrlComponmentInfo);
59  if(!bSuccess)
60  {
61  return FALSE;
62  }
63 
64  switch(UrlComponmentInfo.nScheme)
65  {
70  // supported
71  return TRUE;
72 
73  default:
74  return FALSE;
75  }
76 }
DWORD dwStructSize
Definition: wininet.h:211
#define TRUE
Definition: types.h:120
static BOOLEAN bSuccess
Definition: drive.cpp:419
DWORD dwSchemeLength
Definition: wininet.h:213
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
INTERNET_SCHEME nScheme
Definition: wininet.h:214
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:1644
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by anonymous_namespace{settingsdlg.cpp}::SettingsDlgProc().

Variable Documentation

◆ NewSettingsInfo

SETTINGS_INFO NewSettingsInfo