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
00e75f2b
Commit
00e75f2b
authored
Dec 22, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Reimplement MENU_FindSubMenu on the 16-bit side using only exported functions.
parent
d4a7a9d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
controls.h
dlls/user32/controls.h
+0
-1
menu.c
dlls/user32/menu.c
+1
-1
msg16.c
dlls/user32/msg16.c
+20
-2
No files found.
dlls/user32/controls.h
View file @
00e75f2b
...
@@ -158,7 +158,6 @@ extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt ) DECLSPEC_HIDDE
...
@@ -158,7 +158,6 @@ extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt ) DECLSPEC_HIDDE
extern
void
MENU_TrackKbdMenuBar
(
HWND
hwnd
,
UINT
wParam
,
WCHAR
wChar
)
DECLSPEC_HIDDEN
;
extern
void
MENU_TrackKbdMenuBar
(
HWND
hwnd
,
UINT
wParam
,
WCHAR
wChar
)
DECLSPEC_HIDDEN
;
extern
UINT
MENU_DrawMenuBar
(
HDC
hDC
,
LPRECT
lprect
,
extern
UINT
MENU_DrawMenuBar
(
HDC
hDC
,
LPRECT
lprect
,
HWND
hwnd
,
BOOL
suppress_draw
)
DECLSPEC_HIDDEN
;
HWND
hwnd
,
BOOL
suppress_draw
)
DECLSPEC_HIDDEN
;
extern
UINT
MENU_FindSubMenu
(
HMENU
*
hmenu
,
HMENU
hSubTarget
)
DECLSPEC_HIDDEN
;
extern
void
MENU_EndMenu
(
HWND
)
DECLSPEC_HIDDEN
;
extern
void
MENU_EndMenu
(
HWND
)
DECLSPEC_HIDDEN
;
/* nonclient area */
/* nonclient area */
...
...
dlls/user32/menu.c
View file @
00e75f2b
...
@@ -656,7 +656,7 @@ static MENUITEM *MENU_FindItem( HMENU *hmenu, UINT *nPos, UINT wFlags )
...
@@ -656,7 +656,7 @@ static MENUITEM *MENU_FindItem( HMENU *hmenu, UINT *nPos, UINT wFlags )
* *hmenu in case it is found in another sub-menu.
* *hmenu in case it is found in another sub-menu.
* If the submenu cannot be found, NO_SELECTED_ITEM is returned.
* If the submenu cannot be found, NO_SELECTED_ITEM is returned.
*/
*/
UINT
MENU_FindSubMenu
(
HMENU
*
hmenu
,
HMENU
hSubTarget
)
static
UINT
MENU_FindSubMenu
(
HMENU
*
hmenu
,
HMENU
hSubTarget
)
{
{
POPUPMENU
*
menu
;
POPUPMENU
*
menu
;
UINT
i
;
UINT
i
;
...
...
dlls/user32/msg16.c
View file @
00e75f2b
...
@@ -587,6 +587,24 @@ static HANDLE16 convert_handle_32_to_16(UINT_PTR src, unsigned int flags)
...
@@ -587,6 +587,24 @@ static HANDLE16 convert_handle_32_to_16(UINT_PTR src, unsigned int flags)
return
dst
;
return
dst
;
}
}
static
int
find_sub_menu
(
HMENU
*
hmenu
,
HMENU16
target
)
{
int
i
,
pos
,
count
=
GetMenuItemCount
(
*
hmenu
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
HMENU
sub
=
GetSubMenu
(
*
hmenu
,
i
);
if
(
!
sub
)
continue
;
if
(
HMENU_16
(
sub
)
==
target
)
return
i
;
if
((
pos
=
find_sub_menu
(
&
sub
,
target
))
!=
-
1
)
{
*
hmenu
=
sub
;
return
pos
;
}
}
return
-
1
;
}
/**********************************************************************
/**********************************************************************
* WINPROC_CallProc16To32A
* WINPROC_CallProc16To32A
*/
*/
...
@@ -825,8 +843,8 @@ LRESULT WINPROC_CallProc16To32A( winproc_callback_t callback, HWND16 hwnd, UINT1
...
@@ -825,8 +843,8 @@ LRESULT WINPROC_CallProc16To32A( winproc_callback_t callback, HWND16 hwnd, UINT1
if
((
LOWORD
(
lParam
)
&
MF_POPUP
)
&&
(
LOWORD
(
lParam
)
!=
0xFFFF
))
if
((
LOWORD
(
lParam
)
&
MF_POPUP
)
&&
(
LOWORD
(
lParam
)
!=
0xFFFF
))
{
{
HMENU
hmenu
=
HMENU_32
(
HIWORD
(
lParam
));
HMENU
hmenu
=
HMENU_32
(
HIWORD
(
lParam
));
UINT
pos
=
MENU_FindSubMenu
(
&
hmenu
,
HMENU_32
(
wParam
)
);
int
pos
=
find_sub_menu
(
&
hmenu
,
wParam
);
if
(
pos
==
0xffff
)
pos
=
0
;
/* NO_SELECTED_ITEM */
if
(
pos
==
-
1
)
pos
=
0
;
wParam
=
pos
;
wParam
=
pos
;
}
}
ret
=
callback
(
hwnd32
,
msg
,
MAKEWPARAM
(
wParam
,
LOWORD
(
lParam
)
),
ret
=
callback
(
hwnd32
,
msg
,
MAKEWPARAM
(
wParam
,
LOWORD
(
lParam
)
),
...
...
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