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
Zsolt Vadász
wine
Commits
f2963aeb
Commit
f2963aeb
authored
21 years ago
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
21 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make national (hot)keys work in menus. Make menu code use unicode APIs.
parent
a63270f1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controls/menu.c
+71
-72
71 additions, 72 deletions
controls/menu.c
dlls/user/controls.h
+2
-1
2 additions, 1 deletion
dlls/user/controls.h
with
73 additions
and
73 deletions
controls/menu.c
+
71
−
72
View file @
f2963aeb
...
@@ -29,10 +29,7 @@
...
@@ -29,10 +29,7 @@
#include
"config.h"
#include
"config.h"
#include
"wine/port.h"
#include
"wine/port.h"
#include
<assert.h>
#include
<ctype.h>
#include
<stdarg.h>
#include
<stdarg.h>
#include
<stdlib.h>
#include
<string.h>
#include
<string.h>
#include
"windef.h"
#include
"windef.h"
...
@@ -186,7 +183,7 @@ DWORD WINAPI DrawMenuBarTemp(HWND hwnd, HDC hDC, LPRECT lprect, HMENU hMenu, HFO
...
@@ -186,7 +183,7 @@ DWORD WINAPI DrawMenuBarTemp(HWND hwnd, HDC hDC, LPRECT lprect, HMENU hMenu, HFO
*/
*/
const
struct
builtin_class_descr
MENU_builtin_class
=
const
struct
builtin_class_descr
MENU_builtin_class
=
{
{
POPUPMENU_CLASS_ATOM
,
/* name */
POPUPMENU_CLASS_ATOM
A
,
/* name */
CS_GLOBALCLASS
|
CS_SAVEBITS
,
/* style */
CS_GLOBALCLASS
|
CS_SAVEBITS
,
/* style */
NULL
,
/* procA (winproc is Unicode only) */
NULL
,
/* procA (winproc is Unicode only) */
PopupMenuWndProc
,
/* procW */
PopupMenuWndProc
,
/* procW */
...
@@ -331,7 +328,9 @@ static HMENU get_win_sys_menu( HWND hwnd )
...
@@ -331,7 +328,9 @@ static HMENU get_win_sys_menu( HWND hwnd )
*/
*/
static
HMENU
MENU_CopySysPopup
(
void
)
static
HMENU
MENU_CopySysPopup
(
void
)
{
{
HMENU
hMenu
=
LoadMenuA
(
GetModuleHandleA
(
"USER32"
),
"SYSMENU"
);
static
const
WCHAR
user32W
[]
=
{
'U'
,
'S'
,
'E'
,
'R'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
sysmenuW
[]
=
{
'S'
,
'Y'
,
'S'
,
'M'
,
'E'
,
'N'
,
'U'
,
0
};
HMENU
hMenu
=
LoadMenuW
(
GetModuleHandleW
(
user32W
),
sysmenuW
);
if
(
hMenu
)
{
if
(
hMenu
)
{
POPUPMENU
*
menu
=
MENU_GetMenu
(
hMenu
);
POPUPMENU
*
menu
=
MENU_GetMenu
(
hMenu
);
...
@@ -374,7 +373,7 @@ HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu )
...
@@ -374,7 +373,7 @@ HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu )
if
(
hPopupMenu
)
if
(
hPopupMenu
)
{
{
InsertMenu
A
(
hMenu
,
-
1
,
MF_SYSMENU
|
MF_POPUP
|
MF_BYPOSITION
,
InsertMenu
W
(
hMenu
,
-
1
,
MF_SYSMENU
|
MF_POPUP
|
MF_BYPOSITION
,
(
UINT_PTR
)
hPopupMenu
,
NULL
);
(
UINT_PTR
)
hPopupMenu
,
NULL
);
menu
->
items
[
0
].
fType
=
MF_SYSMENU
|
MF_POPUP
;
menu
->
items
[
0
].
fType
=
MF_SYSMENU
|
MF_POPUP
;
...
@@ -396,10 +395,10 @@ HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu )
...
@@ -396,10 +395,10 @@ HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu )
*
*
* Menus initialisation.
* Menus initialisation.
*/
*/
BOOL
MENU_Init
()
BOOL
MENU_Init
(
void
)
{
{
HBITMAP
hBitmap
;
HBITMAP
hBitmap
;
NONCLIENTMETRICS
A
ncm
;
NONCLIENTMETRICS
W
ncm
;
static
unsigned
char
shade_bits
[
16
]
=
{
0x55
,
0
,
0xAA
,
0
,
static
unsigned
char
shade_bits
[
16
]
=
{
0x55
,
0
,
0xAA
,
0
,
0x55
,
0
,
0xAA
,
0
,
0x55
,
0
,
0xAA
,
0
,
...
@@ -407,14 +406,14 @@ BOOL MENU_Init()
...
@@ -407,14 +406,14 @@ BOOL MENU_Init()
0x55
,
0
,
0xAA
,
0
};
0x55
,
0
,
0xAA
,
0
};
/* Load menu bitmaps */
/* Load menu bitmaps */
hStdMnArrow
=
LoadBitmap
A
(
0
,
MAKEINTRESOURCE
A
(
OBM_MNARROW
));
hStdMnArrow
=
LoadBitmap
W
(
0
,
MAKEINTRESOURCE
W
(
OBM_MNARROW
));
/* Load system buttons bitmaps */
/* Load system buttons bitmaps */
hBmpSysMenu
=
LoadBitmap
A
(
0
,
MAKEINTRESOURCE
A
(
OBM_CLOSE
));
hBmpSysMenu
=
LoadBitmap
W
(
0
,
MAKEINTRESOURCE
W
(
OBM_CLOSE
));
if
(
hStdMnArrow
)
if
(
hStdMnArrow
)
{
{
BITMAP
bm
;
BITMAP
bm
;
GetObject
A
(
hStdMnArrow
,
sizeof
(
bm
),
&
bm
);
GetObject
W
(
hStdMnArrow
,
sizeof
(
bm
),
&
bm
);
arrow_bitmap_width
=
bm
.
bmWidth
;
arrow_bitmap_width
=
bm
.
bmWidth
;
arrow_bitmap_height
=
bm
.
bmHeight
;
arrow_bitmap_height
=
bm
.
bmHeight
;
}
else
}
else
...
@@ -430,18 +429,18 @@ BOOL MENU_Init()
...
@@ -430,18 +429,18 @@ BOOL MENU_Init()
if
(
!
(
MENU_DefSysPopup
=
MENU_CopySysPopup
()))
if
(
!
(
MENU_DefSysPopup
=
MENU_CopySysPopup
()))
return
FALSE
;
return
FALSE
;
ncm
.
cbSize
=
sizeof
(
NONCLIENTMETRICS
A
);
ncm
.
cbSize
=
sizeof
(
NONCLIENTMETRICS
W
);
if
(
!
(
SystemParametersInfo
A
(
SPI_GETNONCLIENTMETRICS
,
sizeof
(
NONCLIENTMETRICS
A
),
&
ncm
,
0
)))
if
(
!
(
SystemParametersInfo
W
(
SPI_GETNONCLIENTMETRICS
,
sizeof
(
NONCLIENTMETRICS
W
),
&
ncm
,
0
)))
return
FALSE
;
return
FALSE
;
if
(
!
(
hMenuFont
=
CreateFontIndirect
A
(
&
ncm
.
lfMenuFont
)))
if
(
!
(
hMenuFont
=
CreateFontIndirect
W
(
&
ncm
.
lfMenuFont
)))
return
FALSE
;
return
FALSE
;
ncm
.
lfMenuFont
.
lfWeight
+=
300
;
ncm
.
lfMenuFont
.
lfWeight
+=
300
;
if
(
ncm
.
lfMenuFont
.
lfWeight
>
1000
)
if
(
ncm
.
lfMenuFont
.
lfWeight
>
1000
)
ncm
.
lfMenuFont
.
lfWeight
=
1000
;
ncm
.
lfMenuFont
.
lfWeight
=
1000
;
if
(
!
(
hMenuFontBold
=
CreateFontIndirect
A
(
&
ncm
.
lfMenuFont
)))
if
(
!
(
hMenuFontBold
=
CreateFontIndirect
W
(
&
ncm
.
lfMenuFont
)))
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
...
@@ -667,7 +666,7 @@ static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu,
...
@@ -667,7 +666,7 @@ static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu,
static
UINT
MENU_FindItemByKey
(
HWND
hwndOwner
,
HMENU
hmenu
,
static
UINT
MENU_FindItemByKey
(
HWND
hwndOwner
,
HMENU
hmenu
,
UINT
key
,
BOOL
forceMenuChar
)
UINT
key
,
BOOL
forceMenuChar
)
{
{
TRACE
(
"
\t
looking for '%c' in [%p]
\n
"
,
(
char
)
key
,
hmenu
);
TRACE
(
"
\t
looking for '%c'
(0x%02x)
in [%p]
\n
"
,
(
char
)
key
,
key
,
hmenu
);
if
(
!
IsMenu
(
hmenu
))
hmenu
=
GetSubMenu
(
get_win_sys_menu
(
hwndOwner
),
0
);
if
(
!
IsMenu
(
hmenu
))
hmenu
=
GetSubMenu
(
get_win_sys_menu
(
hwndOwner
),
0
);
...
@@ -675,13 +674,13 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
...
@@ -675,13 +674,13 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
{
{
POPUPMENU
*
menu
=
MENU_GetMenu
(
hmenu
);
POPUPMENU
*
menu
=
MENU_GetMenu
(
hmenu
);
MENUITEM
*
item
=
menu
->
items
;
MENUITEM
*
item
=
menu
->
items
;
L
ONG
menuchar
;
L
RESULT
menuchar
;
if
(
!
forceMenuChar
)
if
(
!
forceMenuChar
)
{
{
UINT
i
;
UINT
i
;
key
=
toupper
(
key
);
key
=
toupper
W
(
key
);
for
(
i
=
0
;
i
<
menu
->
nItems
;
i
++
,
item
++
)
for
(
i
=
0
;
i
<
menu
->
nItems
;
i
++
,
item
++
)
{
{
if
(
IS_STRING_ITEM
(
item
->
fType
)
&&
item
->
text
)
if
(
IS_STRING_ITEM
(
item
->
fType
)
&&
item
->
text
)
...
@@ -692,11 +691,11 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
...
@@ -692,11 +691,11 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
p
=
strchrW
(
p
+
2
,
'&'
);
p
=
strchrW
(
p
+
2
,
'&'
);
}
}
while
(
p
!=
NULL
&&
p
[
1
]
==
'&'
);
while
(
p
!=
NULL
&&
p
[
1
]
==
'&'
);
if
(
p
&&
(
toupper
(
p
[
1
])
==
key
))
return
i
;
if
(
p
&&
(
toupper
W
(
p
[
1
])
==
key
))
return
i
;
}
}
}
}
}
}
menuchar
=
SendMessage
A
(
hwndOwner
,
WM_MENUCHAR
,
menuchar
=
SendMessage
W
(
hwndOwner
,
WM_MENUCHAR
,
MAKEWPARAM
(
key
,
menu
->
wFlags
),
(
LPARAM
)
hmenu
);
MAKEWPARAM
(
key
,
menu
->
wFlags
),
(
LPARAM
)
hmenu
);
if
(
HIWORD
(
menuchar
)
==
2
)
return
LOWORD
(
menuchar
);
if
(
HIWORD
(
menuchar
)
==
2
)
return
LOWORD
(
menuchar
);
if
(
HIWORD
(
menuchar
)
==
1
)
return
(
UINT
)(
-
2
);
if
(
HIWORD
(
menuchar
)
==
1
)
return
(
UINT
)(
-
2
);
...
@@ -747,7 +746,7 @@ static void MENU_GetBitmapItemSize( UINT id, DWORD data, SIZE *size )
...
@@ -747,7 +746,7 @@ static void MENU_GetBitmapItemSize( UINT id, DWORD data, SIZE *size )
return
;
return
;
}
}
}
}
if
(
GetObject
A
(
bmp
,
sizeof
(
bm
),
&
bm
))
if
(
GetObject
W
(
bmp
,
sizeof
(
bm
),
&
bm
))
{
{
size
->
cx
=
bm
.
bmWidth
;
size
->
cx
=
bm
.
bmWidth
;
size
->
cy
=
bm
.
bmHeight
;
size
->
cy
=
bm
.
bmHeight
;
...
@@ -782,12 +781,12 @@ static void MENU_DrawBitmapItem( HDC hdc, MENUITEM *lpitem, const RECT *rect, BO
...
@@ -782,12 +781,12 @@ static void MENU_DrawBitmapItem( HDC hdc, MENUITEM *lpitem, const RECT *rect, BO
if
(
lpitem
->
dwItemData
)
if
(
lpitem
->
dwItemData
)
{
{
bmp
=
(
HBITMAP
)
lpitem
->
dwItemData
;
bmp
=
(
HBITMAP
)
lpitem
->
dwItemData
;
if
(
!
GetObject
A
(
bmp
,
sizeof
(
bm
),
&
bm
))
return
;
if
(
!
GetObject
W
(
bmp
,
sizeof
(
bm
),
&
bm
))
return
;
}
}
else
else
{
{
bmp
=
hBmpSysMenu
;
bmp
=
hBmpSysMenu
;
if
(
!
GetObject
A
(
bmp
,
sizeof
(
bm
),
&
bm
))
return
;
if
(
!
GetObject
W
(
bmp
,
sizeof
(
bm
),
&
bm
))
return
;
/* only use right half of the bitmap */
/* only use right half of the bitmap */
bmp_xoffset
=
bm
.
bmWidth
/
2
;
bmp_xoffset
=
bm
.
bmWidth
/
2
;
bm
.
bmWidth
-=
bmp_xoffset
;
bm
.
bmWidth
-=
bmp_xoffset
;
...
@@ -824,7 +823,7 @@ static void MENU_DrawBitmapItem( HDC hdc, MENUITEM *lpitem, const RECT *rect, BO
...
@@ -824,7 +823,7 @@ static void MENU_DrawBitmapItem( HDC hdc, MENUITEM *lpitem, const RECT *rect, BO
return
;
return
;
}
}
if
(
!
bmp
||
!
GetObject
A
(
bmp
,
sizeof
(
bm
),
&
bm
))
return
;
if
(
!
bmp
||
!
GetObject
W
(
bmp
,
sizeof
(
bm
),
&
bm
))
return
;
got_bitmap:
got_bitmap:
hdcMem
=
CreateCompatibleDC
(
hdc
);
hdcMem
=
CreateCompatibleDC
(
hdc
);
...
@@ -880,7 +879,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
...
@@ -880,7 +879,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
mis
.
itemData
=
(
DWORD
)
lpitem
->
dwItemData
;
mis
.
itemData
=
(
DWORD
)
lpitem
->
dwItemData
;
mis
.
itemHeight
=
0
;
mis
.
itemHeight
=
0
;
mis
.
itemWidth
=
0
;
mis
.
itemWidth
=
0
;
SendMessage
A
(
hwndOwner
,
WM_MEASUREITEM
,
0
,
(
LPARAM
)
&
mis
);
SendMessage
W
(
hwndOwner
,
WM_MEASUREITEM
,
0
,
(
LPARAM
)
&
mis
);
lpitem
->
rect
.
right
+=
mis
.
itemWidth
;
lpitem
->
rect
.
right
+=
mis
.
itemWidth
;
if
(
menuBar
)
if
(
menuBar
)
...
@@ -1176,7 +1175,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
...
@@ -1176,7 +1175,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
dis
.
itemID
,
dis
.
itemState
,
dis
.
itemAction
,
dis
.
hwndItem
,
dis
.
itemID
,
dis
.
itemState
,
dis
.
itemAction
,
dis
.
hwndItem
,
dis
.
hDC
,
dis
.
rcItem
.
left
,
dis
.
rcItem
.
top
,
dis
.
rcItem
.
right
,
dis
.
hDC
,
dis
.
rcItem
.
left
,
dis
.
rcItem
.
top
,
dis
.
rcItem
.
right
,
dis
.
rcItem
.
bottom
);
dis
.
rcItem
.
bottom
);
SendMessage
A
(
hwndOwner
,
WM_DRAWITEM
,
0
,
(
LPARAM
)
&
dis
);
SendMessage
W
(
hwndOwner
,
WM_DRAWITEM
,
0
,
(
LPARAM
)
&
dis
);
/* Fall through to draw popup-menu arrow */
/* Fall through to draw popup-menu arrow */
}
}
...
@@ -1601,9 +1600,9 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
...
@@ -1601,9 +1600,9 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
}
}
/* NOTE: In Windows, top menu popup is not owned. */
/* NOTE: In Windows, top menu popup is not owned. */
menu
->
hWnd
=
CreateWindow
A
(
POPUPMENU_CLASS_ATOM
,
NULL
,
menu
->
hWnd
=
CreateWindow
ExW
(
0
,
POPUPMENU_CLASS_ATOM
W
,
NULL
,
WS_POPUP
,
x
,
y
,
width
,
height
,
WS_POPUP
,
x
,
y
,
width
,
height
,
hwndOwner
,
0
,
(
HINSTANCE
)
GetWindowLong
A
(
hwndOwner
,
GWL_HINSTANCE
),
hwndOwner
,
0
,
(
HINSTANCE
)
GetWindowLong
W
(
hwndOwner
,
GWL_HINSTANCE
),
(
LPVOID
)
hmenu
);
(
LPVOID
)
hmenu
);
if
(
!
menu
->
hWnd
)
return
FALSE
;
if
(
!
menu
->
hWnd
)
return
FALSE
;
if
(
!
top_popup
)
top_popup
=
menu
->
hWnd
;
if
(
!
top_popup
)
top_popup
=
menu
->
hWnd
;
...
@@ -1660,7 +1659,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
...
@@ -1660,7 +1659,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
if
(
sendMenuSelect
)
if
(
sendMenuSelect
)
{
{
MENUITEM
*
ip
=
&
lppop
->
items
[
lppop
->
FocusedItem
];
MENUITEM
*
ip
=
&
lppop
->
items
[
lppop
->
FocusedItem
];
SendMessage
A
(
hwndOwner
,
WM_MENUSELECT
,
SendMessage
W
(
hwndOwner
,
WM_MENUSELECT
,
MAKELONG
(
ip
->
fType
&
MF_POPUP
?
wIndex
:
ip
->
wID
,
MAKELONG
(
ip
->
fType
&
MF_POPUP
?
wIndex
:
ip
->
wID
,
ip
->
fType
|
ip
->
fState
|
MF_MOUSESELECT
|
ip
->
fType
|
ip
->
fState
|
MF_MOUSESELECT
|
(
lppop
->
wFlags
&
MF_SYSMENU
)),
(
LPARAM
)
hmenu
);
(
lppop
->
wFlags
&
MF_SYSMENU
)),
(
LPARAM
)
hmenu
);
...
@@ -1672,7 +1671,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
...
@@ -1672,7 +1671,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
if
((
pos
=
MENU_FindSubMenu
(
&
topmenu
,
hmenu
))
!=
NO_SELECTED_ITEM
){
if
((
pos
=
MENU_FindSubMenu
(
&
topmenu
,
hmenu
))
!=
NO_SELECTED_ITEM
){
POPUPMENU
*
ptm
=
MENU_GetMenu
(
topmenu
);
POPUPMENU
*
ptm
=
MENU_GetMenu
(
topmenu
);
MENUITEM
*
ip
=
&
ptm
->
items
[
pos
];
MENUITEM
*
ip
=
&
ptm
->
items
[
pos
];
SendMessage
A
(
hwndOwner
,
WM_MENUSELECT
,
MAKELONG
(
pos
,
SendMessage
W
(
hwndOwner
,
WM_MENUSELECT
,
MAKELONG
(
pos
,
ip
->
fType
|
ip
->
fState
|
MF_MOUSESELECT
|
ip
->
fType
|
ip
->
fState
|
MF_MOUSESELECT
|
(
ptm
->
wFlags
&
MF_SYSMENU
)),
(
LPARAM
)
topmenu
);
(
ptm
->
wFlags
&
MF_SYSMENU
)),
(
LPARAM
)
topmenu
);
}
}
...
@@ -2043,7 +2042,7 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
...
@@ -2043,7 +2042,7 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
/* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */
/* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
SendMessage
A
(
hwndOwner
,
WM_INITMENUPOPUP
,
(
WPARAM
)
item
->
hSubMenu
,
SendMessage
W
(
hwndOwner
,
WM_INITMENUPOPUP
,
(
WPARAM
)
item
->
hSubMenu
,
MAKELONG
(
menu
->
FocusedItem
,
IS_SYSTEM_MENU
(
menu
)
));
MAKELONG
(
menu
->
FocusedItem
,
IS_SYSTEM_MENU
(
menu
)
));
item
=
&
menu
->
items
[
menu
->
FocusedItem
];
item
=
&
menu
->
items
[
menu
->
FocusedItem
];
...
@@ -2069,8 +2068,8 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
...
@@ -2069,8 +2068,8 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
if
(
IS_SYSTEM_MENU
(
menu
))
if
(
IS_SYSTEM_MENU
(
menu
))
{
{
MENU_InitSysMenuPopup
(
item
->
hSubMenu
,
MENU_InitSysMenuPopup
(
item
->
hSubMenu
,
GetWindowLong
A
(
menu
->
hWnd
,
GWL_STYLE
),
GetWindowLong
W
(
menu
->
hWnd
,
GWL_STYLE
),
GetClassLong
A
(
menu
->
hWnd
,
GCL_STYLE
));
GetClassLong
W
(
menu
->
hWnd
,
GCL_STYLE
));
NC_GetSysPopupPos
(
menu
->
hWnd
,
&
rect
);
NC_GetSysPopupPos
(
menu
->
hWnd
,
&
rect
);
rect
.
top
=
rect
.
bottom
;
rect
.
top
=
rect
.
bottom
;
...
@@ -2178,10 +2177,10 @@ static INT MENU_ExecFocusedItem( MTRACKER* pmt, HMENU hMenu, UINT wFlags )
...
@@ -2178,10 +2177,10 @@ static INT MENU_ExecFocusedItem( MTRACKER* pmt, HMENU hMenu, UINT wFlags )
if
(
!
(
wFlags
&
TPM_RETURNCMD
))
if
(
!
(
wFlags
&
TPM_RETURNCMD
))
{
{
if
(
menu
->
wFlags
&
MF_SYSMENU
)
if
(
menu
->
wFlags
&
MF_SYSMENU
)
PostMessage
A
(
pmt
->
hOwnerWnd
,
WM_SYSCOMMAND
,
item
->
wID
,
PostMessage
W
(
pmt
->
hOwnerWnd
,
WM_SYSCOMMAND
,
item
->
wID
,
MAKELPARAM
((
INT16
)
pmt
->
pt
.
x
,
(
INT16
)
pmt
->
pt
.
y
)
);
MAKELPARAM
((
INT16
)
pmt
->
pt
.
x
,
(
INT16
)
pmt
->
pt
.
y
)
);
else
else
PostMessage
A
(
pmt
->
hOwnerWnd
,
WM_COMMAND
,
item
->
wID
,
0
);
PostMessage
W
(
pmt
->
hOwnerWnd
,
WM_COMMAND
,
item
->
wID
,
0
);
}
}
return
item
->
wID
;
return
item
->
wID
;
}
}
...
@@ -2384,7 +2383,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk )
...
@@ -2384,7 +2383,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk )
if
(
!
next_menu
.
hmenuNext
||
!
next_menu
.
hwndNext
)
if
(
!
next_menu
.
hmenuNext
||
!
next_menu
.
hwndNext
)
{
{
DWORD
style
=
GetWindowLong
A
(
pmt
->
hOwnerWnd
,
GWL_STYLE
);
DWORD
style
=
GetWindowLong
W
(
pmt
->
hOwnerWnd
,
GWL_STYLE
);
hNewWnd
=
pmt
->
hOwnerWnd
;
hNewWnd
=
pmt
->
hOwnerWnd
;
if
(
IS_SYSTEM_MENU
(
menu
)
)
if
(
IS_SYSTEM_MENU
(
menu
)
)
{
{
...
@@ -2412,7 +2411,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk )
...
@@ -2412,7 +2411,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk )
if
(
IsMenu
(
hNewMenu
)
&&
IsWindow
(
hNewWnd
)
)
if
(
IsMenu
(
hNewMenu
)
&&
IsWindow
(
hNewWnd
)
)
{
{
DWORD
style
=
GetWindowLong
A
(
hNewWnd
,
GWL_STYLE
);
DWORD
style
=
GetWindowLong
W
(
hNewWnd
,
GWL_STYLE
);
if
(
style
&
WS_SYSMENU
&&
if
(
style
&
WS_SYSMENU
&&
GetSubMenu
(
get_win_sys_menu
(
hNewWnd
),
0
)
==
hNewMenu
)
GetSubMenu
(
get_win_sys_menu
(
hNewWnd
),
0
)
==
hNewMenu
)
...
@@ -2466,17 +2465,17 @@ static BOOL MENU_SuspendPopup( MTRACKER* pmt, UINT16 uMsg )
...
@@ -2466,17 +2465,17 @@ static BOOL MENU_SuspendPopup( MTRACKER* pmt, UINT16 uMsg )
msg
.
hwnd
=
pmt
->
hOwnerWnd
;
msg
.
hwnd
=
pmt
->
hOwnerWnd
;
PeekMessage
A
(
&
msg
,
0
,
0
,
0
,
PM_NOYIELD
|
PM_REMOVE
);
PeekMessage
W
(
&
msg
,
0
,
0
,
0
,
PM_NOYIELD
|
PM_REMOVE
);
pmt
->
trackFlags
|=
TF_SKIPREMOVE
;
pmt
->
trackFlags
|=
TF_SKIPREMOVE
;
switch
(
uMsg
)
switch
(
uMsg
)
{
{
case
WM_KEYDOWN
:
case
WM_KEYDOWN
:
PeekMessage
A
(
&
msg
,
0
,
0
,
0
,
PM_NOYIELD
|
PM_NOREMOVE
);
PeekMessage
W
(
&
msg
,
0
,
0
,
0
,
PM_NOYIELD
|
PM_NOREMOVE
);
if
(
msg
.
message
==
WM_KEYUP
||
msg
.
message
==
WM_PAINT
)
if
(
msg
.
message
==
WM_KEYUP
||
msg
.
message
==
WM_PAINT
)
{
{
PeekMessage
A
(
&
msg
,
0
,
0
,
0
,
PM_NOYIELD
|
PM_REMOVE
);
PeekMessage
W
(
&
msg
,
0
,
0
,
0
,
PM_NOYIELD
|
PM_REMOVE
);
PeekMessage
A
(
&
msg
,
0
,
0
,
0
,
PM_NOYIELD
|
PM_NOREMOVE
);
PeekMessage
W
(
&
msg
,
0
,
0
,
0
,
PM_NOYIELD
|
PM_NOREMOVE
);
if
(
msg
.
message
==
WM_KEYDOWN
&&
if
(
msg
.
message
==
WM_KEYDOWN
&&
(
msg
.
wParam
==
VK_LEFT
||
msg
.
wParam
==
VK_RIGHT
))
(
msg
.
wParam
==
VK_LEFT
||
msg
.
wParam
==
VK_RIGHT
))
{
{
...
@@ -2684,11 +2683,11 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
...
@@ -2684,11 +2683,11 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
for
(;;)
for
(;;)
{
{
if
(
PeekMessage
A
(
&
msg
,
0
,
0
,
0
,
PM_NOREMOVE
))
if
(
PeekMessage
W
(
&
msg
,
0
,
0
,
0
,
PM_NOREMOVE
))
{
{
if
(
!
CallMsgFilter
A
(
&
msg
,
MSGF_MENU
))
break
;
if
(
!
CallMsgFilter
W
(
&
msg
,
MSGF_MENU
))
break
;
/* remove the message from the queue */
/* remove the message from the queue */
PeekMessage
A
(
&
msg
,
0
,
msg
.
message
,
msg
.
message
,
PM_REMOVE
);
PeekMessage
W
(
&
msg
,
0
,
msg
.
message
,
msg
.
message
,
PM_REMOVE
);
}
}
else
else
{
{
...
@@ -2709,7 +2708,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
...
@@ -2709,7 +2708,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
fEndMenu
=
TRUE
;
fEndMenu
=
TRUE
;
/* remove the message from the queue */
/* remove the message from the queue */
PeekMessage
A
(
&
msg
,
0
,
msg
.
message
,
msg
.
message
,
PM_REMOVE
);
PeekMessage
W
(
&
msg
,
0
,
msg
.
message
,
msg
.
message
,
PM_REMOVE
);
/* break out of internal loop, ala ESCAPE */
/* break out of internal loop, ala ESCAPE */
break
;
break
;
...
@@ -2835,7 +2834,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
...
@@ -2835,7 +2834,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
hi
.
hItemHandle
=
hmenu
;
hi
.
hItemHandle
=
hmenu
;
hi
.
dwContextId
=
menu
->
dwContextHelpID
;
hi
.
dwContextId
=
menu
->
dwContextHelpID
;
hi
.
MousePos
=
msg
.
pt
;
hi
.
MousePos
=
msg
.
pt
;
SendMessage
A
(
hwnd
,
WM_HELP
,
0
,
(
LPARAM
)
&
hi
);
SendMessage
W
(
hwnd
,
WM_HELP
,
0
,
(
LPARAM
)
&
hi
);
break
;
break
;
}
}
...
@@ -2868,7 +2867,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
...
@@ -2868,7 +2867,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
/* Hack to avoid control chars. */
/* Hack to avoid control chars. */
/* We will find a better way real soon... */
/* We will find a better way real soon... */
if
(
(
msg
.
wParam
<
=
32
)
||
(
msg
.
wParam
>=
127
))
break
;
if
(
msg
.
wParam
<
32
)
break
;
pos
=
MENU_FindItemByKey
(
mt
.
hOwnerWnd
,
mt
.
hCurrentMenu
,
pos
=
MENU_FindItemByKey
(
mt
.
hOwnerWnd
,
mt
.
hCurrentMenu
,
LOWORD
(
msg
.
wParam
),
FALSE
);
LOWORD
(
msg
.
wParam
),
FALSE
);
...
@@ -2887,7 +2886,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
...
@@ -2887,7 +2886,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
}
}
else
else
{
{
DispatchMessage
A
(
&
msg
);
DispatchMessage
W
(
&
msg
);
}
}
if
(
!
fEndMenu
)
fRemove
=
TRUE
;
if
(
!
fEndMenu
)
fRemove
=
TRUE
;
...
@@ -2895,7 +2894,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
...
@@ -2895,7 +2894,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
/* finally remove message from the queue */
/* finally remove message from the queue */
if
(
fRemove
&&
!
(
mt
.
trackFlags
&
TF_SKIPREMOVE
)
)
if
(
fRemove
&&
!
(
mt
.
trackFlags
&
TF_SKIPREMOVE
)
)
PeekMessage
A
(
&
msg
,
0
,
msg
.
message
,
msg
.
message
,
PM_REMOVE
);
PeekMessage
W
(
&
msg
,
0
,
msg
.
message
,
msg
.
message
,
PM_REMOVE
);
else
mt
.
trackFlags
&=
~
TF_SKIPREMOVE
;
else
mt
.
trackFlags
&=
~
TF_SKIPREMOVE
;
}
}
...
@@ -2919,7 +2918,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
...
@@ -2919,7 +2918,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
menu
->
hWnd
=
0
;
menu
->
hWnd
=
0
;
}
}
MENU_SelectItem
(
mt
.
hOwnerWnd
,
mt
.
hTopMenu
,
NO_SELECTED_ITEM
,
FALSE
,
0
);
MENU_SelectItem
(
mt
.
hOwnerWnd
,
mt
.
hTopMenu
,
NO_SELECTED_ITEM
,
FALSE
,
0
);
SendMessage
A
(
mt
.
hOwnerWnd
,
WM_MENUSELECT
,
MAKELONG
(
0
,
0xffff
),
0
);
SendMessage
W
(
mt
.
hOwnerWnd
,
WM_MENUSELECT
,
MAKELONG
(
0
,
0xffff
),
0
);
}
}
/* Reset the variable for hiding menu */
/* Reset the variable for hiding menu */
...
@@ -2941,14 +2940,14 @@ static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags)
...
@@ -2941,14 +2940,14 @@ static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags)
/* Send WM_ENTERMENULOOP and WM_INITMENU message only if TPM_NONOTIFY flag is not specified */
/* Send WM_ENTERMENULOOP and WM_INITMENU message only if TPM_NONOTIFY flag is not specified */
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
SendMessage
A
(
hWnd
,
WM_ENTERMENULOOP
,
bPopup
,
0
);
SendMessage
W
(
hWnd
,
WM_ENTERMENULOOP
,
bPopup
,
0
);
SendMessage
A
(
hWnd
,
WM_SETCURSOR
,
(
WPARAM
)
hWnd
,
HTCAPTION
);
SendMessage
W
(
hWnd
,
WM_SETCURSOR
,
(
WPARAM
)
hWnd
,
HTCAPTION
);
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
{
{
POPUPMENU
*
menu
;
POPUPMENU
*
menu
;
SendMessage
A
(
hWnd
,
WM_INITMENU
,
(
WPARAM
)
hMenu
,
0
);
SendMessage
W
(
hWnd
,
WM_INITMENU
,
(
WPARAM
)
hMenu
,
0
);
if
((
menu
=
MENU_GetMenu
(
hMenu
))
&&
(
!
menu
->
Height
))
if
((
menu
=
MENU_GetMenu
(
hMenu
))
&&
(
!
menu
->
Height
))
{
/* app changed/recreated menu bar entries in WM_INITMENU
{
/* app changed/recreated menu bar entries in WM_INITMENU
Recalculate menu sizes else clicks will not work */
Recalculate menu sizes else clicks will not work */
...
@@ -2966,7 +2965,7 @@ static BOOL MENU_ExitTracking(HWND hWnd)
...
@@ -2966,7 +2965,7 @@ static BOOL MENU_ExitTracking(HWND hWnd)
{
{
TRACE
(
"hwnd=%p
\n
"
,
hWnd
);
TRACE
(
"hwnd=%p
\n
"
,
hWnd
);
SendMessage
A
(
hWnd
,
WM_EXITMENULOOP
,
0
,
0
);
SendMessage
W
(
hWnd
,
WM_EXITMENULOOP
,
0
,
0
);
ShowCaret
(
0
);
ShowCaret
(
0
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -3009,7 +3008,7 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
...
@@ -3009,7 +3008,7 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
/* find window that has a menu */
/* find window that has a menu */
while
(
GetWindowLong
A
(
hwnd
,
GWL_STYLE
)
&
WS_CHILD
)
while
(
GetWindowLong
W
(
hwnd
,
GWL_STYLE
)
&
WS_CHILD
)
if
(
!
(
hwnd
=
GetParent
(
hwnd
)))
return
;
if
(
!
(
hwnd
=
GetParent
(
hwnd
)))
return
;
/* check if we have to track a system menu */
/* check if we have to track a system menu */
...
@@ -3017,8 +3016,8 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
...
@@ -3017,8 +3016,8 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
hTrackMenu
=
GetMenu
(
hwnd
);
hTrackMenu
=
GetMenu
(
hwnd
);
if
(
!
hTrackMenu
||
IsIconic
(
hwnd
)
||
vkey
==
VK_SPACE
)
if
(
!
hTrackMenu
||
IsIconic
(
hwnd
)
||
vkey
==
VK_SPACE
)
{
{
if
(
!
(
GetWindowLong
A
(
hwnd
,
GWL_STYLE
)
&
WS_SYSMENU
))
return
;
if
(
!
(
GetWindowLong
W
(
hwnd
,
GWL_STYLE
)
&
WS_SYSMENU
))
return
;
if
(
GetWindowLong
A
(
hwnd
,
GWL_EXSTYLE
)
&
WS_EX_MANAGED
)
return
;
if
(
GetWindowLong
W
(
hwnd
,
GWL_EXSTYLE
)
&
WS_EX_MANAGED
)
return
;
hTrackMenu
=
get_win_sys_menu
(
hwnd
);
hTrackMenu
=
get_win_sys_menu
(
hwnd
);
uItem
=
0
;
uItem
=
0
;
wParam
|=
HTSYSMENU
;
/* prevent item lookup */
wParam
|=
HTSYSMENU
;
/* prevent item lookup */
...
@@ -3045,7 +3044,7 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
...
@@ -3045,7 +3044,7 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
if
(
uItem
==
NO_SELECTED_ITEM
)
if
(
uItem
==
NO_SELECTED_ITEM
)
MENU_MoveSelection
(
hwnd
,
hTrackMenu
,
ITEM_NEXT
);
MENU_MoveSelection
(
hwnd
,
hTrackMenu
,
ITEM_NEXT
);
else
if
(
vkey
)
else
if
(
vkey
)
PostMessage
A
(
hwnd
,
WM_KEYDOWN
,
VK_DOWN
,
0L
);
PostMessage
W
(
hwnd
,
WM_KEYDOWN
,
VK_DOWN
,
0L
);
MENU_TrackMenu
(
hTrackMenu
,
wFlags
,
0
,
0
,
hwnd
,
NULL
);
MENU_TrackMenu
(
hTrackMenu
,
wFlags
,
0
,
0
,
hwnd
,
NULL
);
}
}
...
@@ -3069,7 +3068,7 @@ BOOL WINAPI TrackPopupMenu( HMENU hMenu, UINT wFlags, INT x, INT y,
...
@@ -3069,7 +3068,7 @@ BOOL WINAPI TrackPopupMenu( HMENU hMenu, UINT wFlags, INT x, INT y,
/* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */
/* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
if
(
!
(
wFlags
&
TPM_NONOTIFY
))
SendMessage
A
(
hWnd
,
WM_INITMENUPOPUP
,
(
WPARAM
)
hMenu
,
0
);
SendMessage
W
(
hWnd
,
WM_INITMENUPOPUP
,
(
WPARAM
)
hMenu
,
0
);
if
(
MENU_ShowPopup
(
hWnd
,
hMenu
,
0
,
x
,
y
,
0
,
0
))
if
(
MENU_ShowPopup
(
hWnd
,
hMenu
,
0
,
x
,
y
,
0
,
0
))
ret
=
MENU_TrackMenu
(
hMenu
,
wFlags
|
TPM_POPUPMENU
,
0
,
0
,
hWnd
,
lpRect
);
ret
=
MENU_TrackMenu
(
hMenu
,
wFlags
|
TPM_POPUPMENU
,
0
,
0
,
hWnd
,
lpRect
);
...
@@ -3118,7 +3117,7 @@ static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
...
@@ -3118,7 +3117,7 @@ static LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
PAINTSTRUCT
ps
;
PAINTSTRUCT
ps
;
BeginPaint
(
hwnd
,
&
ps
);
BeginPaint
(
hwnd
,
&
ps
);
MENU_DrawPopupMenu
(
hwnd
,
ps
.
hdc
,
MENU_DrawPopupMenu
(
hwnd
,
ps
.
hdc
,
(
HMENU
)
GetWindowLong
A
(
hwnd
,
0
)
);
(
HMENU
)
GetWindowLong
W
(
hwnd
,
0
)
);
EndPaint
(
hwnd
,
&
ps
);
EndPaint
(
hwnd
,
&
ps
);
return
0
;
return
0
;
}
}
...
@@ -3748,7 +3747,7 @@ BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
...
@@ -3748,7 +3747,7 @@ BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
*/
*/
HMENU
WINAPI
GetMenu
(
HWND
hWnd
)
HMENU
WINAPI
GetMenu
(
HWND
hWnd
)
{
{
HMENU
retvalue
=
(
HMENU
)
GetWindowLong
A
(
hWnd
,
GWL_ID
);
HMENU
retvalue
=
(
HMENU
)
GetWindowLong
W
(
hWnd
,
GWL_ID
);
TRACE
(
"for %p returning %p
\n
"
,
hWnd
,
retvalue
);
TRACE
(
"for %p returning %p
\n
"
,
hWnd
,
retvalue
);
return
retvalue
;
return
retvalue
;
}
}
...
@@ -3766,7 +3765,7 @@ BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
...
@@ -3766,7 +3765,7 @@ BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
WARN
(
"hMenu %p is not a menu handle
\n
"
,
hMenu
);
WARN
(
"hMenu %p is not a menu handle
\n
"
,
hMenu
);
return
FALSE
;
return
FALSE
;
}
}
if
(
GetWindowLong
A
(
hWnd
,
GWL_STYLE
)
&
WS_CHILD
)
return
FALSE
;
if
(
GetWindowLong
W
(
hWnd
,
GWL_STYLE
)
&
WS_CHILD
)
return
FALSE
;
hWnd
=
WIN_GetFullHandle
(
hWnd
);
hWnd
=
WIN_GetFullHandle
(
hWnd
);
if
(
GetCapture
()
==
hWnd
)
MENU_SetCapture
(
0
);
/* release the capture */
if
(
GetCapture
()
==
hWnd
)
MENU_SetCapture
(
0
);
/* release the capture */
...
@@ -3780,7 +3779,7 @@ BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
...
@@ -3780,7 +3779,7 @@ BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
lpmenu
->
hWnd
=
hWnd
;
lpmenu
->
hWnd
=
hWnd
;
lpmenu
->
Height
=
0
;
/* Make sure we recalculate the size */
lpmenu
->
Height
=
0
;
/* Make sure we recalculate the size */
}
}
SetWindowLong
A
(
hWnd
,
GWL_ID
,
(
LONG_PTR
)
hMenu
);
SetWindowLong
W
(
hWnd
,
GWL_ID
,
(
LONG_PTR
)
hMenu
);
if
(
IsWindowVisible
(
hWnd
))
if
(
IsWindowVisible
(
hWnd
))
SetWindowPos
(
hWnd
,
0
,
0
,
0
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
|
SetWindowPos
(
hWnd
,
0
,
0
,
0
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
|
...
@@ -3811,7 +3810,7 @@ BOOL WINAPI DrawMenuBar( HWND hWnd )
...
@@ -3811,7 +3810,7 @@ BOOL WINAPI DrawMenuBar( HWND hWnd )
LPPOPUPMENU
lppop
;
LPPOPUPMENU
lppop
;
HMENU
hMenu
=
GetMenu
(
hWnd
);
HMENU
hMenu
=
GetMenu
(
hWnd
);
if
(
GetWindowLong
A
(
hWnd
,
GWL_STYLE
)
&
WS_CHILD
)
return
FALSE
;
if
(
GetWindowLong
W
(
hWnd
,
GWL_STYLE
)
&
WS_CHILD
)
return
FALSE
;
if
(
!
hMenu
||
!
(
lppop
=
MENU_GetMenu
(
hMenu
)))
return
FALSE
;
if
(
!
hMenu
||
!
(
lppop
=
MENU_GetMenu
(
hMenu
)))
return
FALSE
;
lppop
->
Height
=
0
;
/* Make sure we call MENU_MenuBarCalcSize */
lppop
->
Height
=
0
;
/* Make sure we call MENU_MenuBarCalcSize */
...
@@ -3907,7 +3906,7 @@ void WINAPI EndMenu(void)
...
@@ -3907,7 +3906,7 @@ void WINAPI EndMenu(void)
/* which will now terminate the menu, in the event that */
/* which will now terminate the menu, in the event that */
/* the main window was minimized, or lost focus, so we */
/* the main window was minimized, or lost focus, so we */
/* don't end up with an orphaned menu */
/* don't end up with an orphaned menu */
PostMessage
A
(
top_popup
,
WM_CANCELMODE
,
0
,
0
);
PostMessage
W
(
top_popup
,
WM_CANCELMODE
,
0
,
0
);
}
}
}
}
...
@@ -4661,7 +4660,7 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
...
@@ -4661,7 +4660,7 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
HMENU
hMenu
,
hSubMenu
,
hSysMenu
;
HMENU
hMenu
,
hSubMenu
,
hSysMenu
;
UINT
uSysStat
=
(
UINT
)
-
1
,
uStat
=
(
UINT
)
-
1
,
nPos
;
UINT
uSysStat
=
(
UINT
)
-
1
,
uStat
=
(
UINT
)
-
1
,
nPos
;
hMenu
=
(
GetWindowLong
A
(
hWnd
,
GWL_STYLE
)
&
WS_CHILD
)
?
0
:
GetMenu
(
hWnd
);
hMenu
=
(
GetWindowLong
W
(
hWnd
,
GWL_STYLE
)
&
WS_CHILD
)
?
0
:
GetMenu
(
hWnd
);
hSysMenu
=
get_win_sys_menu
(
hWnd
);
hSysMenu
=
get_win_sys_menu
(
hWnd
);
/* find menu item and ask application to initialize it */
/* find menu item and ask application to initialize it */
...
@@ -4670,12 +4669,12 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
...
@@ -4670,12 +4669,12 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
nPos
=
cmd
;
nPos
=
cmd
;
if
(
MENU_FindItem
(
&
hSubMenu
,
&
nPos
,
MF_BYCOMMAND
))
if
(
MENU_FindItem
(
&
hSubMenu
,
&
nPos
,
MF_BYCOMMAND
))
{
{
SendMessage
A
(
hWnd
,
WM_INITMENU
,
(
WPARAM
)
hSysMenu
,
0L
);
SendMessage
W
(
hWnd
,
WM_INITMENU
,
(
WPARAM
)
hSysMenu
,
0L
);
if
(
hSubMenu
!=
hSysMenu
)
if
(
hSubMenu
!=
hSysMenu
)
{
{
nPos
=
MENU_FindSubMenu
(
&
hSysMenu
,
hSubMenu
);
nPos
=
MENU_FindSubMenu
(
&
hSysMenu
,
hSubMenu
);
TRACE_
(
accel
)(
"hSysMenu = %p, hSubMenu = %p, nPos = %d
\n
"
,
hSysMenu
,
hSubMenu
,
nPos
);
TRACE_
(
accel
)(
"hSysMenu = %p, hSubMenu = %p, nPos = %d
\n
"
,
hSysMenu
,
hSubMenu
,
nPos
);
SendMessage
A
(
hWnd
,
WM_INITMENUPOPUP
,
(
WPARAM
)
hSubMenu
,
MAKELPARAM
(
nPos
,
TRUE
));
SendMessage
W
(
hWnd
,
WM_INITMENUPOPUP
,
(
WPARAM
)
hSubMenu
,
MAKELPARAM
(
nPos
,
TRUE
));
}
}
uSysStat
=
GetMenuState
(
GetSubMenu
(
hSysMenu
,
0
),
cmd
,
MF_BYCOMMAND
);
uSysStat
=
GetMenuState
(
GetSubMenu
(
hSysMenu
,
0
),
cmd
,
MF_BYCOMMAND
);
}
}
...
@@ -4685,12 +4684,12 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
...
@@ -4685,12 +4684,12 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
nPos
=
cmd
;
nPos
=
cmd
;
if
(
MENU_FindItem
(
&
hSubMenu
,
&
nPos
,
MF_BYCOMMAND
))
if
(
MENU_FindItem
(
&
hSubMenu
,
&
nPos
,
MF_BYCOMMAND
))
{
{
SendMessage
A
(
hWnd
,
WM_INITMENU
,
(
WPARAM
)
hMenu
,
0L
);
SendMessage
W
(
hWnd
,
WM_INITMENU
,
(
WPARAM
)
hMenu
,
0L
);
if
(
hSubMenu
!=
hMenu
)
if
(
hSubMenu
!=
hMenu
)
{
{
nPos
=
MENU_FindSubMenu
(
&
hMenu
,
hSubMenu
);
nPos
=
MENU_FindSubMenu
(
&
hMenu
,
hSubMenu
);
TRACE_
(
accel
)(
"hMenu = %p, hSubMenu = %p, nPos = %d
\n
"
,
hMenu
,
hSubMenu
,
nPos
);
TRACE_
(
accel
)(
"hMenu = %p, hSubMenu = %p, nPos = %d
\n
"
,
hMenu
,
hSubMenu
,
nPos
);
SendMessage
A
(
hWnd
,
WM_INITMENUPOPUP
,
(
WPARAM
)
hSubMenu
,
MAKELPARAM
(
nPos
,
FALSE
));
SendMessage
W
(
hWnd
,
WM_INITMENUPOPUP
,
(
WPARAM
)
hSubMenu
,
MAKELPARAM
(
nPos
,
FALSE
));
}
}
uStat
=
GetMenuState
(
hMenu
,
cmd
,
MF_BYCOMMAND
);
uStat
=
GetMenuState
(
hMenu
,
cmd
,
MF_BYCOMMAND
);
}
}
...
@@ -4725,12 +4724,12 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
...
@@ -4725,12 +4724,12 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
if
(
mesg
==
WM_COMMAND
)
if
(
mesg
==
WM_COMMAND
)
{
{
TRACE_
(
accel
)(
", sending WM_COMMAND, wParam=%0x
\n
"
,
0x10000
|
cmd
);
TRACE_
(
accel
)(
", sending WM_COMMAND, wParam=%0x
\n
"
,
0x10000
|
cmd
);
SendMessage
A
(
hWnd
,
mesg
,
0x10000
|
cmd
,
0L
);
SendMessage
W
(
hWnd
,
mesg
,
0x10000
|
cmd
,
0L
);
}
}
else
if
(
mesg
==
WM_SYSCOMMAND
)
else
if
(
mesg
==
WM_SYSCOMMAND
)
{
{
TRACE_
(
accel
)(
", sending WM_SYSCOMMAND, wParam=%0x
\n
"
,
cmd
);
TRACE_
(
accel
)(
", sending WM_SYSCOMMAND, wParam=%0x
\n
"
,
cmd
);
SendMessage
A
(
hWnd
,
mesg
,
cmd
,
0x00010000L
);
SendMessage
W
(
hWnd
,
mesg
,
cmd
,
0x00010000L
);
}
}
else
else
{
{
...
...
This diff is collapsed.
Click to expand it.
dlls/user/controls.h
+
2
−
1
View file @
f2963aeb
...
@@ -25,7 +25,8 @@
...
@@ -25,7 +25,8 @@
#include
"winproc.h"
#include
"winproc.h"
/* Built-in class names (see _Undocumented_Windows_ p.418) */
/* Built-in class names (see _Undocumented_Windows_ p.418) */
#define POPUPMENU_CLASS_ATOM MAKEINTATOMA(32768)
/* PopupMenu */
#define POPUPMENU_CLASS_ATOMA MAKEINTATOMA(32768)
/* PopupMenu */
#define POPUPMENU_CLASS_ATOMW MAKEINTATOMW(32768)
/* PopupMenu */
#define DESKTOP_CLASS_ATOM MAKEINTATOMA(32769)
/* Desktop */
#define DESKTOP_CLASS_ATOM MAKEINTATOMA(32769)
/* Desktop */
#define DIALOG_CLASS_ATOMA MAKEINTATOMA(32770)
/* Dialog */
#define DIALOG_CLASS_ATOMA MAKEINTATOMA(32770)
/* Dialog */
#define DIALOG_CLASS_ATOMW MAKEINTATOMW(32770)
/* Dialog */
#define DIALOG_CLASS_ATOMW MAKEINTATOMW(32770)
/* Dialog */
...
...
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