ReactOS 0.4.16-dev-336-gb667d82
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

static int CALLBACK BrowseFolderCallback (HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
 
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

◆ BrowseFolderCallback()

static int CALLBACK BrowseFolderCallback ( HWND  hwnd,
UINT  uMsg,
LPARAM  lParam,
LPARAM  lpData 
)
static

Definition at line 13 of file settingsdlg.cpp.

14{
15 switch (uMsg)
16 {
19 break;
21 return TRUE;
22 }
23 return 0;
24}
#define TRUE
Definition: types.h:120
#define BFFM_VALIDATEFAILED
Definition: shlobj.h:1257
#define BFFM_SETSELECTIONW
Definition: shlobj.h:1246
#define BFFM_INITIALIZED
Definition: shlobj.h:1236
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by ChooseFolder().

◆ ChooseFolder()

BOOL ChooseFolder ( HWND  hwnd)

Definition at line 27 of file settingsdlg.cpp.

28{
29 BOOL bRet = FALSE;
30 BROWSEINFOW bi;
31 CStringW szChooseFolderText;
32
33 szChooseFolderText.LoadStringW(IDS_CHOOSE_FOLDER_TEXT);
34
35 ZeroMemory(&bi, sizeof(bi));
36 bi.hwndOwner = hwnd;
37 bi.pidlRoot = NULL;
38 bi.lpszTitle = szChooseFolderText;
39 bi.ulFlags =
40 BIF_USENEWUI | BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS | /* BIF_BROWSEFILEJUNCTIONS | */ BIF_VALIDATE;
41
43 {
44 WCHAR szDir[MAX_PATH];
46 {
48 bi.lParam = (LPARAM)szDir;
49 }
50
51 LPITEMIDLIST lpItemList = SHBrowseForFolderW(&bi);
52 if (lpItemList && SHGetPathFromIDListW(lpItemList, szDir))
53 {
54 if (*szDir)
55 {
57 bRet = TRUE;
58 }
59 }
60
61 CoTaskMemFree(lpItemList);
63 }
64
65 return bRet;
66}
#define IDS_CHOOSE_FOLDER_TEXT
Definition: resource.h:108
#define IDC_DOWNLOAD_DIR_EDIT
Definition: resource.h:45
EXTERN_C LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brfolder.cpp:1370
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
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
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1452
static int CALLBACK BrowseFolderCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
Definition: settingsdlg.cpp:13
#define BIF_VALIDATE
Definition: shlobj.h:1222
#define BIF_DONTGOBELOWDOMAIN
Definition: shlobj.h:1218
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1217
#define BIF_USENEWUI
Definition: shlobj.h:1224
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define _countof(array)
Definition: sndvol32.h:70
BFFCALLBACK lpfn
Definition: shlobj.h:1205
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1201
UINT ulFlags
Definition: shlobj.h:1204
HWND hwndOwner
Definition: shlobj.h:1200
LPCWSTR lpszTitle
Definition: shlobj.h:1203
LPARAM lParam
Definition: shlobj.h:1206
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1384
#define ZeroMemory
Definition: winbase.h:1737
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180

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

◆ CreateSettingsDlg()

VOID CreateSettingsDlg ( HWND  hwnd)

Definition at line 293 of file settingsdlg.cpp.

294{
296}
#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:4402
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CMainWindow::OnCommand().

◆ IsUrlValid()

BOOL IsUrlValid ( const WCHAR Url)

Definition at line 69 of file settingsdlg.cpp.

70{
71 URL_COMPONENTSW UrlComponmentInfo = {0};
72 UrlComponmentInfo.dwStructSize = sizeof(UrlComponmentInfo);
73 UrlComponmentInfo.dwSchemeLength = 1;
74
75 BOOL bSuccess = InternetCrackUrlW(Url, wcslen(Url), 0, &UrlComponmentInfo);
76 if (!bSuccess)
77 {
78 return FALSE;
79 }
80
81 switch (UrlComponmentInfo.nScheme)
82 {
87 // supported
88 return TRUE;
89
90 default:
91 return FALSE;
92 }
93}
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:1625
static BOOLEAN bSuccess
Definition: drive.cpp:355
_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