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
81563234
Commit
81563234
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: Add Favorites menu to IE.
parent
515eb3d7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
9 deletions
+95
-9
En.rc
dlls/shdocvw/En.rc
+5
-0
ie.c
dlls/shdocvw/ie.c
+1
-9
iexplore.c
dlls/shdocvw/iexplore.c
+86
-0
resource.h
dlls/shdocvw/resource.h
+2
-0
shdocvw.h
dlls/shdocvw/shdocvw.h
+1
-0
No files found.
dlls/shdocvw/En.rc
View file @
81563234
...
...
@@ -50,6 +50,11 @@ IDR_BROWSE_MAIN_MENU MENU
MENUITEM SEPARATOR
MENUITEM "&Properties...", ID_BROWSE_PROPERTIES
}
POPUP "&Favorites"
{
MENUITEM "&Add to Favorites..." ID_BROWSE_ADDFAV
MENUITEM SEPARATOR
}
POPUP "&Help"
{
MENUITEM "&About Internet Explorer...", ID_BROWSE_ABOUT
...
...
dlls/shdocvw/ie.c
View file @
81563234
...
...
@@ -430,19 +430,11 @@ static HRESULT WINAPI InternetExplorer_put_MenuBar(IWebBrowser2 *iface, VARIANT_
TRACE
(
"(%p)->(%x)
\n
"
,
This
,
Value
);
if
((
menu
=
GetMenu
(
This
->
frame_hwnd
)))
DestroyMenu
(
menu
);
menu
=
NULL
;
if
(
Value
)
menu
=
LoadMenuW
(
shdocvw_hinstance
,
MAKEINTRESOURCEW
(
IDR_BROWSE_MAIN_MENU
))
;
menu
=
This
->
menu
;
if
(
!
SetMenu
(
This
->
frame_hwnd
,
menu
))
{
DestroyMenu
(
menu
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
return
S_OK
;
}
...
...
dlls/shdocvw/iexplore.c
View file @
81563234
...
...
@@ -34,6 +34,9 @@
#include "shdocvw.h"
#include "mshtmcid.h"
#include "shellapi.h"
#include "winreg.h"
#include "shlwapi.h"
#include "intshcut.h"
#include "wine/debug.h"
...
...
@@ -75,6 +78,87 @@ void adjust_ie_docobj_rect(HWND frame, RECT* rc)
}
}
static
HMENU
get_fav_menu
(
HMENU
menu
)
{
return
GetSubMenu
(
menu
,
1
);
}
static
void
add_fav_to_menu
(
HMENU
menu
,
LPWSTR
title
)
{
MENUITEMINFOW
item
;
item
.
cbSize
=
sizeof
(
item
);
item
.
fMask
=
MIIM_FTYPE
|
MIIM_STRING
;
item
.
fType
=
MFT_STRING
;
item
.
dwTypeData
=
title
;
InsertMenuItemW
(
menu
,
GetMenuItemCount
(
menu
),
TRUE
,
&
item
);
}
static
void
add_favs_to_menu
(
HMENU
menu
,
LPCWSTR
dir
)
{
WCHAR
path
[
MAX_PATH
*
2
];
const
WCHAR
urlext
[]
=
{
'*'
,
'.'
,
'u'
,
'r'
,
'l'
,
0
};
WCHAR
*
filename
;
HANDLE
findhandle
;
WIN32_FIND_DATAW
finddata
;
IUniformResourceLocatorW
*
urlobj
;
IPersistFile
*
urlfile
;
HRESULT
res
;
lstrcpyW
(
path
,
dir
);
PathAppendW
(
path
,
urlext
);
findhandle
=
FindFirstFileW
(
path
,
&
finddata
);
if
(
findhandle
==
INVALID_HANDLE_VALUE
)
return
;
res
=
CoCreateInstance
(
&
CLSID_InternetShortcut
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IUniformResourceLocatorW
,
(
PVOID
*
)
&
urlobj
);
if
(
SUCCEEDED
(
res
))
res
=
IUnknown_QueryInterface
(
urlobj
,
&
IID_IPersistFile
,
(
PVOID
*
)
&
urlfile
);
if
(
SUCCEEDED
(
res
))
{
filename
=
path
+
lstrlenW
(
path
)
-
lstrlenW
(
urlext
);
do
{
WCHAR
*
fileext
;
lstrcpyW
(
filename
,
finddata
.
cFileName
);
if
(
FAILED
(
IPersistFile_Load
(
urlfile
,
path
,
0
)))
continue
;
fileext
=
filename
+
lstrlenW
(
filename
)
-
lstrlenW
(
urlext
)
+
1
;
*
fileext
=
0
;
add_fav_to_menu
(
menu
,
filename
);
}
while
(
FindNextFileW
(
findhandle
,
&
finddata
));
}
if
(
urlfile
)
IPersistFile_Release
(
urlfile
);
if
(
urlobj
)
IUnknown_Release
(
urlobj
);
FindClose
(
findhandle
);
}
static
HMENU
create_ie_menu
(
void
)
{
HMENU
menu
=
LoadMenuW
(
shdocvw_hinstance
,
MAKEINTRESOURCEW
(
IDR_BROWSE_MAIN_MENU
));
WCHAR
path
[
MAX_PATH
];
if
(
SHGetFolderPathW
(
NULL
,
CSIDL_COMMON_FAVORITES
,
NULL
,
SHGFP_TYPE_CURRENT
,
path
)
==
S_OK
)
add_favs_to_menu
(
get_fav_menu
(
menu
),
path
);
if
(
SHGetFolderPathW
(
NULL
,
CSIDL_FAVORITES
,
NULL
,
SHGFP_TYPE_CURRENT
,
path
)
==
S_OK
)
add_favs_to_menu
(
get_fav_menu
(
menu
),
path
);
return
menu
;
}
static
INT_PTR
CALLBACK
ie_dialog_open_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
static
InternetExplorer
*
This
;
...
...
@@ -167,6 +251,8 @@ static LRESULT iewnd_OnCreate(HWND hwnd, LPCREATESTRUCTW lpcs)
InternetExplorer
*
This
=
(
InternetExplorer
*
)
lpcs
->
lpCreateParams
;
SetWindowLongPtrW
(
hwnd
,
0
,
(
LONG_PTR
)
lpcs
->
lpCreateParams
);
This
->
menu
=
create_ie_menu
();
This
->
status_hwnd
=
CreateStatusWindowW
(
CCS_NODIVIDER
|
WS_CHILD
|
WS_VISIBLE
,
NULL
,
hwnd
,
IDC_BROWSE_STATUSBAR
);
SendMessageW
(
This
->
status_hwnd
,
SB_SIMPLE
,
TRUE
,
0
);
...
...
dlls/shdocvw/resource.h
View file @
81563234
...
...
@@ -37,3 +37,5 @@
#define ID_BROWSE_PRINT_PREVIEW 277
#define ID_BROWSE_PROPERTIES 262
#define ID_BROWSE_ABOUT 336
#define ID_BROWSE_ADDFAV 1200
dlls/shdocvw/shdocvw.h
View file @
81563234
...
...
@@ -190,6 +190,7 @@ struct InternetExplorer {
HWND
frame_hwnd
;
HWND
status_hwnd
;
HMENU
menu
;
DocHost
doc_host
;
};
...
...
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