Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e859230e
Commit
e859230e
authored
Oct 01, 2010
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Oct 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcpl: Add general propsheet and allow to set the homepage.
parent
80545ef9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
249 additions
and
2 deletions
+249
-2
Makefile.in
dlls/inetcpl.cpl/Makefile.in
+2
-1
cpl_En.rc
dlls/inetcpl.cpl/cpl_En.rc
+17
-0
general.c
dlls/inetcpl.cpl/general.c
+212
-0
inetcpl.c
dlls/inetcpl.cpl/inetcpl.c
+6
-1
inetcpl.h
dlls/inetcpl.cpl/inetcpl.h
+12
-0
No files found.
dlls/inetcpl.cpl/Makefile.in
View file @
e859230e
MODULE
=
inetcpl.cpl
IMPORTS
=
comctl32
user
32
IMPORTS
=
comctl32
shlwapi user32 advapi
32
DELAYIMPORTS
=
cryptui
C_SRCS
=
\
content.c
\
general.c
\
inetcpl.c
RC_SRCS
=
\
...
...
dlls/inetcpl.cpl/cpl_En.rc
View file @
e859230e
...
...
@@ -29,6 +29,23 @@ BEGIN
IDS_CPL_INFO "Configure Wine Internet Browser and related settings"
END
/* "General" propsheet */
IDD_GENERAL DIALOG 0, 0, 320, 220
STYLE WS_CAPTION | WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
CAPTION "General"
BEGIN
GROUPBOX " Home page ", IDC_STATIC, 4, 4, 312, 52
LTEXT "You can choose the address that will be used as your home page.",
IDC_STATIC, 58, 10, 252, 10
EDITTEXT IDC_HOME_EDIT, 58, 22, 252, 12, WS_VISIBLE | ES_AUTOHSCROLL
PUSHBUTTON "&Current page", IDC_HOME_CURRENT, 58, 36, 80, 14
PUSHBUTTON "&Default page", IDC_HOME_DEFAULT, 144, 36, 80, 14
PUSHBUTTON "&Blank page", IDC_HOME_BLANK, 230, 36, 80, 14
END
/* "Content" propsheet */
IDD_CONTENT DIALOG 0, 0, 320, 220
STYLE WS_CAPTION | WS_CHILD | WS_DISABLED
...
...
dlls/inetcpl.cpl/general.c
0 → 100644
View file @
e859230e
/*
* Internet control panel applet: general propsheet
*
* Copyright 2010 Detlef Riekenberg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#define NONAMELESSUNION
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <wininet.h>
#include <winreg.h>
#include <shlwapi.h>
#include <prsht.h>
#include "inetcpl.h"
#include "wine/debug.h"
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
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'
,
'\\'
,
'M'
,
'a'
,
'i'
,
'n'
,
0
};
/* list of unimplemented buttons */
static
DWORD
disable_me
[]
=
{
IDC_HOME_CURRENT
,
IDC_HOME_DEFAULT
,
0
};
/*********************************************************************
* parse_url_from_outside [internal]
*
* Filter an URL, add a usable scheme, when needed
*
*/
static
DWORD
parse_url_from_outside
(
LPCWSTR
url
,
LPWSTR
out
,
DWORD
maxlen
)
{
HMODULE
hdll
;
DWORD
(
WINAPI
*
pParseURLFromOutsideSourceW
)(
LPCWSTR
,
LPWSTR
,
LPDWORD
,
LPDWORD
);
DWORD
res
;
hdll
=
LoadLibraryA
(
"shdocvw.dll"
);
pParseURLFromOutsideSourceW
=
(
void
*
)
GetProcAddress
(
hdll
,
(
LPSTR
)
170
);
if
(
pParseURLFromOutsideSourceW
)
{
res
=
pParseURLFromOutsideSourceW
(
url
,
out
,
&
maxlen
,
NULL
);
FreeLibrary
(
hdll
);
return
res
;
}
ERR
(
"failed to get ordinal 170: %d
\n
"
,
GetLastError
());
FreeLibrary
(
hdll
);
return
0
;
}
/*********************************************************************
* general_on_command [internal]
*
* handle WM_COMMAND
*
*/
static
INT_PTR
general_on_command
(
HWND
hwnd
,
WPARAM
wparam
)
{
switch
(
wparam
)
{
case
MAKEWPARAM
(
IDC_HOME_EDIT
,
EN_CHANGE
):
/* enable apply button */
SendMessageW
(
GetParent
(
hwnd
),
PSM_CHANGED
,
(
WPARAM
)
hwnd
,
0
);
break
;
case
MAKEWPARAM
(
IDC_HOME_BLANK
,
BN_CLICKED
):
SetDlgItemTextW
(
hwnd
,
IDC_HOME_EDIT
,
about_blank
);
break
;
default:
TRACE
(
"not implemented for command: %d/%d
\n
"
,
HIWORD
(
wparam
),
LOWORD
(
wparam
));
return
FALSE
;
}
return
TRUE
;
}
/*********************************************************************
* general_on_initdialog [internal]
*
* handle WM_INITDIALOG
*
*/
static
VOID
general_on_initdialog
(
HWND
hwnd
)
{
WCHAR
buffer
[
INTERNET_MAX_URL_LENGTH
];
DWORD
len
;
DWORD
type
;
LONG
res
;
DWORD
*
ptr
=
disable_me
;
/* disable unimplemented buttons */
while
(
*
ptr
)
{
EnableWindow
(
GetDlgItem
(
hwnd
,
*
ptr
),
FALSE
);
ptr
++
;
}
/* read current homepage from the registry. Try HCU first, then HKLM */
*
buffer
=
0
;
len
=
sizeof
(
buffer
);
type
=
REG_SZ
;
res
=
SHRegGetUSValueW
(
reg_ie_main
,
start_page
,
&
type
,
buffer
,
&
len
,
FALSE
,
(
LPBYTE
)
about_blank
,
sizeof
(
about_blank
));
if
(
!
res
&&
(
type
==
REG_SZ
))
{
SetDlgItemTextW
(
hwnd
,
IDC_HOME_EDIT
,
buffer
);
}
}
/*********************************************************************
* general_on_notify [internal]
*
* handle WM_NOTIFY
*
*/
static
INT_PTR
general_on_notify
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
)
{
PSHNOTIFY
*
psn
;
WCHAR
buffer
[
INTERNET_MAX_URL_LENGTH
];
WCHAR
parsed
[
INTERNET_MAX_URL_LENGTH
];
LONG
res
;
psn
=
(
PSHNOTIFY
*
)
lparam
;
TRACE
(
"WM_NOTIFY (%p, 0x%lx, 0x%lx) from %p with code: %d
\n
"
,
hwnd
,
wparam
,
lparam
,
psn
->
hdr
.
hwndFrom
,
psn
->
hdr
.
code
);
if
(
psn
->
hdr
.
code
==
PSN_APPLY
)
{
*
buffer
=
0
;
GetDlgItemTextW
(
hwnd
,
IDC_HOME_EDIT
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
));
TRACE
(
"EDITTEXT has %s
\n
"
,
debugstr_w
(
buffer
));
res
=
parse_url_from_outside
(
buffer
,
parsed
,
sizeof
(
parsed
)
/
sizeof
(
WCHAR
));
TRACE
(
"got %d with %s
\n
"
,
res
,
debugstr_w
(
parsed
));
if
(
res
)
{
HKEY
hkey
;
/* update the dialog, when needed */
if
(
lstrcmpW
(
buffer
,
parsed
))
SetDlgItemTextW
(
hwnd
,
IDC_HOME_EDIT
,
parsed
);
/* update the registry */
res
=
RegOpenKeyW
(
HKEY_CURRENT_USER
,
reg_ie_main
,
&
hkey
);
if
(
!
res
)
{
res
=
RegSetValueExW
(
hkey
,
start_page
,
0
,
REG_SZ
,
(
const
BYTE
*
)
parsed
,
(
lstrlenW
(
parsed
)
+
1
)
*
sizeof
(
WCHAR
));
RegCloseKey
(
hkey
);
return
!
res
;
}
}
}
return
FALSE
;
}
/*********************************************************************
* general_dlgproc [internal]
*
*/
INT_PTR
CALLBACK
general_dlgproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
switch
(
msg
)
{
case
WM_INITDIALOG
:
general_on_initdialog
(
hwnd
);
return
TRUE
;
case
WM_COMMAND
:
return
general_on_command
(
hwnd
,
wparam
);
case
WM_NOTIFY
:
return
general_on_notify
(
hwnd
,
wparam
,
lparam
);
default:
/* do not flood the log */
if
((
msg
==
WM_SETCURSOR
)
||
(
msg
==
WM_NCHITTEST
)
||
(
msg
==
WM_MOUSEMOVE
))
return
FALSE
;
TRACE
(
"(%p, 0x%08x/%d, 0x%lx, 0x%lx)
\n
"
,
hwnd
,
msg
,
msg
,
wparam
,
lparam
);
}
return
FALSE
;
}
dlls/inetcpl.cpl/inetcpl.c
View file @
e859230e
...
...
@@ -27,7 +27,6 @@
#include <wingdi.h>
#include <winuser.h>
#include <commctrl.h>
#include <commdlg.h>
#include <cpl.h>
#include "wine/debug.h"
...
...
@@ -93,6 +92,12 @@ static void display_cpl_sheets(HWND parent)
/* Fill out all PROPSHEETPAGE */
psp
[
id
].
dwSize
=
sizeof
(
PROPSHEETPAGEW
);
psp
[
id
].
hInstance
=
hcpl
;
psp
[
id
].
u
.
pszTemplate
=
MAKEINTRESOURCEW
(
IDD_GENERAL
);
psp
[
id
].
pfnDlgProc
=
general_dlgproc
;
id
++
;
psp
[
id
].
dwSize
=
sizeof
(
PROPSHEETPAGEW
);
psp
[
id
].
hInstance
=
hcpl
;
psp
[
id
].
u
.
pszTemplate
=
MAKEINTRESOURCEW
(
IDD_CONTENT
);
psp
[
id
].
pfnDlgProc
=
content_dlgproc
;
id
++
;
...
...
dlls/inetcpl.cpl/inetcpl.h
View file @
e859230e
...
...
@@ -19,12 +19,16 @@
*
*/
#ifndef __WINE_INETCPL__
#define __WINE_INETCPL__
#include <windef.h>
#include <winuser.h>
extern
HMODULE
hcpl
;
INT_PTR
CALLBACK
content_dlgproc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
)
DECLSPEC_HIDDEN
;
INT_PTR
CALLBACK
general_dlgproc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
)
DECLSPEC_HIDDEN
;
#define NUM_PROPERTY_PAGES 8
...
...
@@ -38,6 +42,14 @@ INT_PTR CALLBACK content_dlgproc(HWND, UINT, WPARAM, LPARAM) DECLSPEC_HIDDEN;
/* dialogs */
#define IDC_STATIC -1
#define IDD_GENERAL 1000
#define IDC_HOME_EDIT 1000
#define IDC_HOME_CURRENT 1001
#define IDC_HOME_DEFAULT 1002
#define IDC_HOME_BLANK 1003
#define IDD_CONTENT 4000
#define IDC_CERT 4100
#define IDC_CERT_PUBLISHER 4101
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment