inetcpl: Implement default page button.

Based on a patch by Jared Smudde.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2016-02-25 18:51:17 +11:00 committed by Alexandre Julliard
parent 1c862ca479
commit 1510b8b92a
1 changed files with 12 additions and 1 deletions

View File

@ -36,6 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(inetcpl);
static const WCHAR about_blank[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
static const WCHAR start_page[] = {'S','t','a','r','t',' ','P','a','g','e',0};
static const WCHAR default_page[] = {'D','e','f','a','u','l','t','_','P','a','g','e','_','U','R','L',0};
static const WCHAR reg_ie_main[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r','\\',
@ -43,7 +44,6 @@ static const WCHAR reg_ie_main[] = {'S','o','f','t','w','a','r','e','\\',
/* list of unimplemented buttons */
static DWORD disabled_general_buttons[] = {IDC_HOME_CURRENT,
IDC_HOME_DEFAULT,
IDC_HISTORY_SETTINGS,
0};
static DWORD disabled_delhist_buttons[] = {IDC_DELETE_FORM_DATA,
@ -175,6 +175,10 @@ static DWORD parse_url_from_outside(LPCWSTR url, LPWSTR out, DWORD maxlen)
*/
static INT_PTR general_on_command(HWND hwnd, WPARAM wparam)
{
WCHAR buffer[INTERNET_MAX_URL_LENGTH];
DWORD len;
DWORD type;
LONG res;
switch (wparam)
{
@ -187,6 +191,13 @@ static INT_PTR general_on_command(HWND hwnd, WPARAM wparam)
SetDlgItemTextW(hwnd, IDC_HOME_EDIT, about_blank);
break;
case MAKEWPARAM(IDC_HOME_DEFAULT, BN_CLICKED):
len = sizeof(buffer);
type = REG_SZ;
res = SHRegGetUSValueW(reg_ie_main, default_page, &type, buffer, &len, FALSE, (LPBYTE) about_blank, sizeof(about_blank));
if (!res && (type == REG_SZ)) SetDlgItemTextW(hwnd, IDC_HOME_EDIT, buffer);
break;
case MAKEWPARAM(IDC_HISTORY_DELETE, BN_CLICKED):
DialogBoxW(hcpl, MAKEINTRESOURCEW(IDD_DELETE_HISTORY), hwnd,
delhist_dlgproc);