Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
abc1e565
Commit
abc1e565
authored
14 years ago
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
shdocvw: Recurse into directories when adding Favorite in IE.
parent
ae01727f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/shdocvw/iexplore.c
+63
-19
63 additions, 19 deletions
dlls/shdocvw/iexplore.c
with
63 additions
and
19 deletions
dlls/shdocvw/iexplore.c
+
63
−
19
View file @
abc1e565
...
...
@@ -105,11 +105,31 @@ static void free_fav_menu_data(HMENU menu)
heap_free
((
LPWSTR
)
url
);
}
static
void
add_fav_to_menu
(
HMENU
menu
,
LPWSTR
title
,
LPCWSTR
url
)
static
int
get_menu_item_count
(
HMENU
menu
)
{
MENUITEMINFOW
item
;
int
count
=
0
;
int
i
;
item
.
cbSize
=
sizeof
(
item
);
item
.
fMask
=
MIIM_DATA
|
MIIM_SUBMENU
;
for
(
i
=
0
;
GetMenuItemInfoW
(
menu
,
i
,
TRUE
,
&
item
);
i
++
)
{
if
(
item
.
hSubMenu
)
count
+=
get_menu_item_count
(
item
.
hSubMenu
);
else
count
++
;
}
return
count
;
}
static
void
add_fav_to_menu
(
HMENU
favmenu
,
HMENU
menu
,
LPWSTR
title
,
LPCWSTR
url
)
{
MENUITEMINFOW
item
;
/* Subtract the number of standard elements in the Favorites menu */
INT
favcount
=
G
et
M
enu
I
tem
C
ount
(
menu
)
-
2
;
int
favcount
=
g
et
_m
enu
_i
tem
_c
ount
(
fav
menu
)
-
2
;
LPWSTR
urlbuf
;
if
(
favcount
>
(
ID_BROWSE_GOTOFAV_MAX
-
ID_BROWSE_GOTOFAV_FIRST
))
...
...
@@ -131,13 +151,13 @@ static void add_fav_to_menu(HMENU menu, LPWSTR title, LPCWSTR url)
item
.
dwTypeData
=
title
;
item
.
wID
=
ID_BROWSE_GOTOFAV_FIRST
+
favcount
;
item
.
dwItemData
=
(
ULONG_PTR
)
urlbuf
;
InsertMenuItemW
(
menu
,
favcount
+
2
,
TRUE
,
&
item
);
InsertMenuItemW
(
menu
,
-
1
,
TRUE
,
&
item
);
}
static
void
add_favs_to_menu
(
HMENU
menu
,
LPCWSTR
dir
)
static
void
add_favs_to_menu
(
HMENU
favmenu
,
HMENU
menu
,
LPCWSTR
dir
)
{
WCHAR
path
[
MAX_PATH
*
2
];
const
WCHAR
urlext
[]
=
{
'*'
,
'.'
,
'u'
,
'r'
,
'l'
,
0
};
const
WCHAR
search
[]
=
{
'*'
,
0
};
WCHAR
*
filename
;
HANDLE
findhandle
;
WIN32_FIND_DATAW
finddata
;
...
...
@@ -146,7 +166,7 @@ static void add_favs_to_menu(HMENU menu, LPCWSTR dir)
HRESULT
res
;
lstrcpyW
(
path
,
dir
);
PathAppendW
(
path
,
urlext
);
PathAppendW
(
path
,
search
);
findhandle
=
FindFirstFileW
(
path
,
&
finddata
);
...
...
@@ -160,25 +180,48 @@ static void add_favs_to_menu(HMENU menu, LPCWSTR dir)
if
(
SUCCEEDED
(
res
))
{
filename
=
path
+
lstrlenW
(
path
)
-
lstrlenW
(
urlext
);
filename
=
path
+
lstrlenW
(
path
)
-
lstrlenW
(
search
);
do
{
WCHAR
*
fileext
;
WCHAR
*
url
=
NULL
;
lstrcpyW
(
filename
,
finddata
.
cFileName
);
if
(
FAILED
(
IPersistFile_Load
(
urlfile
,
path
,
0
)))
continue
;
if
(
finddata
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
{
MENUITEMINFOW
item
;
const
WCHAR
ignore1
[]
=
{
'.'
,
'.'
,
0
};
const
WCHAR
ignore2
[]
=
{
'.'
,
0
};
if
(
!
lstrcmpW
(
filename
,
ignore1
)
||
!
lstrcmpW
(
filename
,
ignore2
))
continue
;
item
.
cbSize
=
sizeof
(
item
);
item
.
fMask
=
MIIM_STRING
|
MIIM_SUBMENU
;
item
.
dwTypeData
=
filename
;
item
.
hSubMenu
=
CreatePopupMenu
();
InsertMenuItemW
(
menu
,
-
1
,
TRUE
,
&
item
);
add_favs_to_menu
(
favmenu
,
item
.
hSubMenu
,
path
);
}
else
{
WCHAR
*
fileext
;
WCHAR
*
url
=
NULL
;
const
WCHAR
urlext
[]
=
{
'.'
,
'u'
,
'r'
,
'l'
,
0
};
if
(
lstrcmpiW
(
PathFindExtensionW
(
filename
),
urlext
))
continue
;
urlobj
->
lpVtbl
->
GetURL
(
urlobj
,
&
url
);
if
(
FAILED
(
IPersistFile_Load
(
urlfile
,
path
,
0
)))
continue
;
if
(
!
url
)
continue
;
urlobj
->
lpVtbl
->
GetURL
(
urlobj
,
&
url
);
fileext
=
filename
+
lstrlenW
(
filename
)
-
lstrlenW
(
urlext
)
+
1
;
*
fileext
=
0
;
add_fav_to_menu
(
menu
,
filename
,
url
);
if
(
!
url
)
continue
;
fileext
=
filename
+
lstrlenW
(
filename
)
-
lstrlenW
(
urlext
);
*
fileext
=
0
;
add_fav_to_menu
(
favmenu
,
menu
,
filename
,
url
);
}
}
while
(
FindNextFileW
(
findhandle
,
&
finddata
));
}
...
...
@@ -194,13 +237,14 @@ static void add_favs_to_menu(HMENU menu, LPCWSTR dir)
static
HMENU
create_ie_menu
(
void
)
{
HMENU
menu
=
LoadMenuW
(
shdocvw_hinstance
,
MAKEINTRESOURCEW
(
IDR_BROWSE_MAIN_MENU
));
HMENU
favmenu
=
get_fav_menu
(
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
);
add_favs_to_menu
(
favmenu
,
fav
menu
,
path
);
if
(
SHGetFolderPathW
(
NULL
,
CSIDL_FAVORITES
,
NULL
,
SHGFP_TYPE_CURRENT
,
path
)
==
S_OK
)
add_favs_to_menu
(
get_
fav
_
menu
(
menu
)
,
path
);
add_favs_to_menu
(
favmenu
,
fav
menu
,
path
);
return
menu
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment