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
a91bb52c
Commit
a91bb52c
authored
Jul 29, 2010
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Aug 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shdocvw: Allow navigating to Favorites in IE.
parent
81563234
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
4 deletions
+73
-4
iexplore.c
dlls/shdocvw/iexplore.c
+70
-4
resource.h
dlls/shdocvw/resource.h
+3
-0
No files found.
dlls/shdocvw/iexplore.c
View file @
a91bb52c
...
...
@@ -83,15 +83,55 @@ static HMENU get_fav_menu(HMENU menu)
return
GetSubMenu
(
menu
,
1
);
}
static
void
add_fav_to_menu
(
HMENU
menu
,
LPWSTR
title
)
static
LPCWSTR
get_fav_url_from_id
(
HMENU
menu
,
UINT
id
)
{
MENUITEMINFOW
item
;
item
.
cbSize
=
sizeof
(
item
);
item
.
fMask
=
MIIM_FTYPE
|
MIIM_STRING
;
item
.
fMask
=
MIIM_DATA
;
if
(
!
GetMenuItemInfoW
(
menu
,
id
,
FALSE
,
&
item
))
return
NULL
;
return
(
LPWSTR
)
item
.
dwItemData
;
}
static
void
free_fav_menu_data
(
HMENU
menu
)
{
LPCWSTR
url
;
int
i
;
for
(
i
=
0
;
(
url
=
get_fav_url_from_id
(
menu
,
ID_BROWSE_GOTOFAV_FIRST
+
i
));
i
++
)
heap_free
((
LPWSTR
)
url
);
}
static
void
add_fav_to_menu
(
HMENU
menu
,
LPWSTR
title
,
LPCWSTR
url
)
{
MENUITEMINFOW
item
;
/* Subtract the number of standard elements in the Favorites menu */
INT
favcount
=
GetMenuItemCount
(
menu
)
-
2
;
LPWSTR
urlbuf
;
if
(
favcount
>
(
ID_BROWSE_GOTOFAV_MAX
-
ID_BROWSE_GOTOFAV_FIRST
))
{
FIXME
(
"Add support for more than %d Favorites
\n
"
,
favcount
);
return
;
}
urlbuf
=
heap_alloc
((
lstrlenW
(
url
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
urlbuf
)
return
;
lstrcpyW
(
urlbuf
,
url
);
item
.
cbSize
=
sizeof
(
item
);
item
.
fMask
=
MIIM_FTYPE
|
MIIM_STRING
|
MIIM_DATA
|
MIIM_ID
;
item
.
fType
=
MFT_STRING
;
item
.
dwTypeData
=
title
;
InsertMenuItemW
(
menu
,
GetMenuItemCount
(
menu
),
TRUE
,
&
item
);
item
.
wID
=
ID_BROWSE_GOTOFAV_FIRST
+
favcount
;
item
.
dwItemData
=
(
ULONG_PTR
)
urlbuf
;
InsertMenuItemW
(
menu
,
favcount
+
2
,
TRUE
,
&
item
);
}
static
void
add_favs_to_menu
(
HMENU
menu
,
LPCWSTR
dir
)
...
...
@@ -125,14 +165,20 @@ static void add_favs_to_menu(HMENU menu, LPCWSTR dir)
do
{
WCHAR
*
fileext
;
WCHAR
*
url
=
NULL
;
lstrcpyW
(
filename
,
finddata
.
cFileName
);
if
(
FAILED
(
IPersistFile_Load
(
urlfile
,
path
,
0
)))
continue
;
urlobj
->
lpVtbl
->
GetURL
(
urlobj
,
&
url
);
if
(
!
url
)
continue
;
fileext
=
filename
+
lstrlenW
(
filename
)
-
lstrlenW
(
urlext
)
+
1
;
*
fileext
=
0
;
add_fav_to_menu
(
menu
,
filename
);
add_fav_to_menu
(
menu
,
filename
,
url
);
}
while
(
FindNextFileW
(
findhandle
,
&
finddata
));
}
...
...
@@ -159,6 +205,18 @@ static HMENU create_ie_menu(void)
return
menu
;
}
static
void
ie_navigate
(
InternetExplorer
*
This
,
LPCWSTR
url
)
{
VARIANT
variant
;
V_VT
(
&
variant
)
=
VT_BSTR
;
V_BSTR
(
&
variant
)
=
SysAllocString
(
url
);
IWebBrowser2_Navigate2
(
WEBBROWSER2
(
This
),
&
variant
,
NULL
,
NULL
,
NULL
,
NULL
);
SysFreeString
(
V_BSTR
(
&
variant
));
}
static
INT_PTR
CALLBACK
ie_dialog_open_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
static
InternetExplorer
*
This
;
...
...
@@ -310,6 +368,7 @@ static LRESULT iewnd_OnDestroy(InternetExplorer *This)
{
TRACE
(
"%p
\n
"
,
This
);
free_fav_menu_data
(
get_fav_menu
(
This
->
menu
));
This
->
frame_hwnd
=
NULL
;
PostQuitMessage
(
0
);
/* FIXME */
...
...
@@ -343,6 +402,13 @@ static LRESULT CALLBACK iewnd_OnCommand(InternetExplorer *This, HWND hwnd, UINT
break
;
default:
if
(
LOWORD
(
wparam
)
>=
ID_BROWSE_GOTOFAV_FIRST
&&
LOWORD
(
wparam
)
<=
ID_BROWSE_GOTOFAV_MAX
)
{
LPCWSTR
url
=
get_fav_url_from_id
(
get_fav_menu
(
This
->
menu
),
LOWORD
(
wparam
));
if
(
url
)
ie_navigate
(
This
,
url
);
}
return
DefWindowProcW
(
hwnd
,
msg
,
wparam
,
lparam
);
}
return
0
;
...
...
dlls/shdocvw/resource.h
View file @
a91bb52c
...
...
@@ -39,3 +39,6 @@
#define ID_BROWSE_ABOUT 336
#define ID_BROWSE_ADDFAV 1200
#define ID_BROWSE_GOTOFAV_FIRST 2000
#define ID_BROWSE_GOTOFAV_MAX 65000
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