ReactOS 0.4.15-dev-8135-g1bc6c90
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 13 of file settingsdlg.cpp.

14{
15 BOOL bRet = FALSE;
16 BROWSEINFOW bi;
17 CStringW szChooseFolderText;
18
19 szChooseFolderText.LoadStringW(IDS_CHOOSE_FOLDER_TEXT);
20
21 ZeroMemory(&bi, sizeof(bi));
22 bi.hwndOwner = hwnd;
23 bi.pidlRoot = NULL;
24 bi.lpszTitle = szChooseFolderText;
25 bi.ulFlags =
26 BIF_USENEWUI | BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS | /* BIF_BROWSEFILEJUNCTIONS | */ BIF_VALIDATE;
27
29 {
30 CStringW szBuf;
31
32 LPITEMIDLIST lpItemList = SHBrowseForFolderW(&bi);
33 if (lpItemList && SHGetPathFromIDListW(lpItemList, szBuf.GetBuffer(MAX_PATH)))
34 {
35 szBuf.ReleaseBuffer();
36 if (!szBuf.IsEmpty())
37 {
39 bRet = TRUE;
40 }
41 }
42 else
43 {
44 szBuf.ReleaseBuffer();
45 }
46
47 CoTaskMemFree(lpItemList);
49 }
50
51 return bRet;
52}
#define IDS_CHOOSE_FOLDER_TEXT
Definition: resource.h:102
#define IDC_DOWNLOAD_DIR_EDIT
Definition: resource.h:45
EXTERN_C LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brfolder.cpp:1140
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
#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
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:1342
#define BIF_VALIDATE
Definition: shlobj.h:1215
#define BIF_DONTGOBELOWDOMAIN
Definition: shlobj.h:1211
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1210
#define BIF_USENEWUI
Definition: shlobj.h:1217
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1194
UINT ulFlags
Definition: shlobj.h:1197
HWND hwndOwner
Definition: shlobj.h:1193
LPCWSTR lpszTitle
Definition: shlobj.h:1196
#define ZeroMemory
Definition: winbase.h:1712
_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 279 of file settingsdlg.cpp.

280{
282}
#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:4399
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CMainWindow::OnCommand().

◆ IsUrlValid()

BOOL IsUrlValid ( const WCHAR Url)

Definition at line 55 of file settingsdlg.cpp.

56{
57 URL_COMPONENTSW UrlComponmentInfo = {0};
58 UrlComponmentInfo.dwStructSize = sizeof(UrlComponmentInfo);
59 UrlComponmentInfo.dwSchemeLength = 1;
60
61 BOOL bSuccess = InternetCrackUrlW(Url, wcslen(Url), 0, &UrlComponmentInfo);
62 if (!bSuccess)
63 {
64 return FALSE;
65 }
66
67 switch (UrlComponmentInfo.nScheme)
68 {
73 // supported
74 return TRUE;
75
76 default:
77 return FALSE;
78 }
79}
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