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

Go to the source code of this file.

Namespaces

namespace  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}
#define IDS_CHOOSE_FOLDER_TEXT
Definition: resource.h:103
#define IDC_DOWNLOAD_DIR_EDIT
Definition: resource.h:45
bool IsEmpty() const
Definition: atlsimpstr.h:379
PCXSTR GetString() const
Definition: atlsimpstr.h:361
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brsfolder.c:1406
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define SUCCEEDED(hr)
Definition: intsafe.h:50
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1294
#define BIF_VALIDATE
Definition: shlobj.h:1149
#define BIF_DONTGOBELOWDOMAIN
Definition: shlobj.h:1145
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1144
#define BIF_USENEWUI
Definition: shlobj.h:1151
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1128
UINT ulFlags
Definition: shlobj.h:1131
HWND hwndOwner
Definition: shlobj.h:1127
LPCWSTR lpszTitle
Definition: shlobj.h:1130
#define ZeroMemory
Definition: winbase.h:1670
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)

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

◆ CreateSettingsDlg()

VOID CreateSettingsDlg ( HWND  hwnd)

Definition at line 281 of file settingsdlg.cpp.

282{
285 hwnd,
287}
#define IDD_SETTINGS_DIALOG
Definition: resource.h:63
HINSTANCE hInst
Definition: dxdiag.c:13
INT_PTR CALLBACK SettingsDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4389
#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}
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:1625
static BOOLEAN bSuccess
Definition: drive.cpp:433
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
DWORD dwStructSize
Definition: wininet.h:211
INTERNET_SCHEME nScheme
Definition: wininet.h:214
DWORD dwSchemeLength
Definition: wininet.h:213
#define INTERNET_SCHEME_FTP
Definition: winhttp.h:44
#define INTERNET_SCHEME_HTTP
Definition: winhttp.h:42
#define INTERNET_SCHEME_HTTPS
Definition: winhttp.h:43
@ INTERNET_SCHEME_FILE
Definition: wininet.h:143

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

Variable Documentation

◆ NewSettingsInfo

SETTINGS_INFO NewSettingsInfo