Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c946b1cc
Commit
c946b1cc
authored
Oct 24, 2000
by
Aric Stewart
Committed by
Alexandre Julliard
Oct 24, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted menu string handling to Unicode.
parent
4162315e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
67 deletions
+69
-67
menu.c
controls/menu.c
+69
-67
No files found.
controls/menu.c
View file @
c946b1cc
...
...
@@ -31,6 +31,7 @@
#include "message.h"
#include "queue.h"
#include "tweak.h"
#include "wine/unicode.h"
#include "debugtools.h"
...
...
@@ -51,7 +52,7 @@ typedef struct {
HMENU
hSubMenu
;
/* Pop-up menu. */
HBITMAP
hCheckBit
;
/* Bitmap when checked. */
HBITMAP
hUnCheckBit
;
/* Bitmap when unchecked. */
LPSTR
text
;
/* Item text or bitmap handle. */
LP
W
STR
text
;
/* Item text or bitmap handle. */
DWORD
dwItemData
;
/* Application defined. */
DWORD
dwTypeData
;
/* depends on fMask */
HBITMAP
hbmpItem
;
/* bitmap in win98 style menus */
...
...
@@ -250,7 +251,7 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp,
if
(
typ
==
MFT_STRING
)
{
if
(
mp
->
text
)
DPRINTF
(
", Text=
\"
%s
\"
"
,
mp
->
text
);
DPRINTF
(
", Text=
\"
%s
\"
"
,
debugstr_w
(
mp
->
text
)
);
else
DPRINTF
(
", Text=Null"
);
}
else
if
(
mp
->
text
==
NULL
)
...
...
@@ -705,10 +706,10 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
{
if
(
item
->
text
&&
(
IS_STRING_ITEM
(
item
->
fType
)))
{
char
*
p
=
item
->
text
-
2
;
WCHAR
*
p
=
item
->
text
-
2
;
do
{
p
=
strchr
(
p
+
2
,
'&'
);
p
=
strchr
W
(
p
+
2
,
'&'
);
}
while
(
p
!=
NULL
&&
p
[
1
]
==
'&'
);
if
(
p
&&
(
toupper
(
p
[
1
])
==
key
))
return
i
;
...
...
@@ -771,7 +772,7 @@ static HBITMAP MENU_LoadMagicItem(UINT id, BOOL hilite, DWORD dwItemData)
static
void
MENU_CalcItemSize
(
HDC
hdc
,
MENUITEM
*
lpitem
,
HWND
hwndOwner
,
INT
orgX
,
INT
orgY
,
BOOL
menuBar
)
{
char
*
p
;
WCHAR
*
p
;
TRACE
(
"dc=0x%04x owner=0x%04x (%d,%d)
\n
"
,
hdc
,
hwndOwner
,
orgX
,
orgY
);
debug_print_menuitem
(
"MENU_CalcItemSize: menuitem:"
,
lpitem
,
...
...
@@ -862,7 +863,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
if
(
IS_STRING_ITEM
(
lpitem
->
fType
))
{
SIZE
size
;
GetTextExtentPoint32
A
(
hdc
,
lpitem
->
text
,
strlen
(
lpitem
->
text
),
&
size
);
GetTextExtentPoint32
W
(
hdc
,
lpitem
->
text
,
strlenW
(
lpitem
->
text
),
&
size
);
lpitem
->
rect
.
right
+=
size
.
cx
;
if
(
TWEAK_WineLook
==
WIN31_LOOK
)
...
...
@@ -875,16 +876,16 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
{
lpitem
->
rect
.
right
+=
MENU_BAR_ITEMS_SPACE
;
}
else
if
((
p
=
strchr
(
lpitem
->
text
,
'\t'
))
!=
NULL
)
else
if
((
p
=
strchr
W
(
lpitem
->
text
,
'\t'
))
!=
NULL
)
{
/* Item contains a tab (only meaningful in popup menus) */
GetTextExtentPoint32
A
(
hdc
,
lpitem
->
text
,
(
int
)(
p
-
lpitem
->
text
)
,
&
size
);
GetTextExtentPoint32
W
(
hdc
,
lpitem
->
text
,
(
int
)(
p
-
lpitem
->
text
)
,
&
size
);
lpitem
->
xTab
=
check_bitmap_width
+
MENU_TAB_SPACE
+
size
.
cx
;
lpitem
->
rect
.
right
+=
MENU_TAB_SPACE
;
}
else
{
if
(
strchr
(
lpitem
->
text
,
'\b'
))
if
(
strchr
W
(
lpitem
->
text
,
'\b'
))
lpitem
->
rect
.
right
+=
MENU_TAB_SPACE
;
lpitem
->
xTab
=
lpitem
->
rect
.
right
-
check_bitmap_width
-
arrow_bitmap_width
;
...
...
@@ -1310,7 +1311,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
{
rect
.
left
+=
MENU_BAR_ITEMS_SPACE
/
2
;
rect
.
right
-=
MENU_BAR_ITEMS_SPACE
/
2
;
i
=
strlen
(
lpitem
->
text
);
i
=
strlen
W
(
lpitem
->
text
);
}
else
{
...
...
@@ -1325,13 +1326,13 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
{
++
rect
.
left
;
++
rect
.
top
;
++
rect
.
right
;
++
rect
.
bottom
;
SetTextColor
(
hdc
,
RGB
(
0xff
,
0xff
,
0xff
));
DrawText
A
(
hdc
,
lpitem
->
text
,
i
,
&
rect
,
uFormat
);
DrawText
W
(
hdc
,
lpitem
->
text
,
i
,
&
rect
,
uFormat
);
--
rect
.
left
;
--
rect
.
top
;
--
rect
.
right
;
--
rect
.
bottom
;
}
SetTextColor
(
hdc
,
RGB
(
0x80
,
0x80
,
0x80
));
}
DrawText
A
(
hdc
,
lpitem
->
text
,
i
,
&
rect
,
uFormat
);
DrawText
W
(
hdc
,
lpitem
->
text
,
i
,
&
rect
,
uFormat
);
/* paint the shortcut text */
if
(
lpitem
->
text
[
i
])
/* There's a tab or flush-right char */
...
...
@@ -1352,12 +1353,12 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
{
++
rect
.
left
;
++
rect
.
top
;
++
rect
.
right
;
++
rect
.
bottom
;
SetTextColor
(
hdc
,
RGB
(
0xff
,
0xff
,
0xff
));
DrawText
A
(
hdc
,
lpitem
->
text
+
i
+
1
,
-
1
,
&
rect
,
uFormat
);
DrawText
W
(
hdc
,
lpitem
->
text
+
i
+
1
,
-
1
,
&
rect
,
uFormat
);
--
rect
.
left
;
--
rect
.
top
;
--
rect
.
right
;
--
rect
.
bottom
;
}
SetTextColor
(
hdc
,
RGB
(
0x80
,
0x80
,
0x80
));
}
DrawText
A
(
hdc
,
lpitem
->
text
+
i
+
1
,
-
1
,
&
rect
,
uFormat
);
DrawText
W
(
hdc
,
lpitem
->
text
+
i
+
1
,
-
1
,
&
rect
,
uFormat
);
}
if
(
hfontOld
)
...
...
@@ -1802,9 +1803,9 @@ static void MENU_MoveSelection( HWND hwndOwner, HMENU hmenu, INT offset )
* ModifyMenu().
*/
static
BOOL
MENU_SetItemData
(
MENUITEM
*
item
,
UINT
flags
,
UINT
id
,
LPCSTR
str
)
LPC
W
STR
str
)
{
LPSTR
prevText
=
IS_STRING_ITEM
(
item
->
fType
)
?
item
->
text
:
NULL
;
LP
W
STR
prevText
=
IS_STRING_ITEM
(
item
->
fType
)
?
item
->
text
:
NULL
;
debug_print_menuitem
(
"MENU_SetItemData from: "
,
item
,
""
);
...
...
@@ -1817,19 +1818,19 @@ static BOOL MENU_SetItemData( MENUITEM *item, UINT flags, UINT id,
}
else
{
LPSTR
text
;
LP
W
STR
text
;
/* Item beginning with a backspace is a help item */
if
(
*
str
==
'\b'
)
{
flags
|=
MF_HELP
;
str
++
;
}
if
(
!
(
text
=
HEAP_strdup
A
(
SystemHeap
,
0
,
str
)))
return
FALSE
;
if
(
!
(
text
=
HEAP_strdup
W
(
SystemHeap
,
0
,
str
)))
return
FALSE
;
item
->
text
=
text
;
}
}
else
if
(
IS_BITMAP_ITEM
(
flags
))
item
->
text
=
(
LPSTR
)(
HBITMAP
)
LOWORD
(
str
);
item
->
text
=
(
LP
W
STR
)(
HBITMAP
)
LOWORD
(
str
);
else
item
->
text
=
NULL
;
if
(
flags
&
MF_OWNERDRAW
)
...
...
@@ -1951,7 +1952,7 @@ static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode )
ERR
(
"not a string item %04x
\n
"
,
flags
);
str
=
res
;
if
(
!
unicode
)
res
+=
strlen
(
str
)
+
1
;
else
res
+=
(
l
strlenW
((
LPCWSTR
)
str
)
+
1
)
*
sizeof
(
WCHAR
);
else
res
+=
(
strlenW
((
LPCWSTR
)
str
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
flags
&
MF_POPUP
)
{
HMENU
hSubMenu
=
CreatePopupMenu
();
...
...
@@ -1997,7 +1998,7 @@ static LPCSTR MENUEX_ParseResource( LPCSTR res, HMENU hMenu)
/* Align the text on a word boundary. */
res
+=
(
~
((
int
)
res
-
1
))
&
1
;
mii
.
dwTypeData
=
(
LPWSTR
)
res
;
res
+=
(
1
+
l
strlenW
(
mii
.
dwTypeData
))
*
sizeof
(
WCHAR
);
res
+=
(
1
+
strlenW
(
mii
.
dwTypeData
))
*
sizeof
(
WCHAR
);
/* Align the following fields on a dword boundary. */
res
+=
(
~
((
int
)
res
-
1
))
&
3
;
...
...
@@ -2637,9 +2638,9 @@ static void MENU_KeyRight( MTRACKER* pmt, UINT wFlags )
TRACE
(
"MENU_KeyRight called, cur %x (%s), top %x (%s).
\n
"
,
pmt
->
hCurrentMenu
,
(
MENU_GetMenu
(
pmt
->
hCurrentMenu
))
->
items
[
0
].
text
,
pmt
->
hTopMenu
,
menu
->
items
[
0
].
text
);
debugstr_w
(
(
MENU_GetMenu
(
pmt
->
hCurrentMenu
))
->
items
[
0
].
text
)
,
pmt
->
hTopMenu
,
debugstr_w
(
menu
->
items
[
0
].
text
)
);
if
(
(
menu
->
wFlags
&
MF_POPUP
)
||
(
pmt
->
hCurrentMenu
!=
pmt
->
hTopMenu
))
{
...
...
@@ -3421,9 +3422,9 @@ INT WINAPI GetMenuStringA(
hMenu
,
wItemID
,
str
,
nMaxSiz
,
wFlags
);
if
(
!
(
item
=
MENU_FindItem
(
&
hMenu
,
&
wItemID
,
wFlags
)))
return
0
;
if
(
!
IS_STRING_ITEM
(
item
->
fType
))
return
0
;
if
(
!
str
||
!
nMaxSiz
)
return
strlen
(
item
->
text
);
if
(
!
str
||
!
nMaxSiz
)
return
strlen
W
(
item
->
text
);
str
[
0
]
=
'\0'
;
lstrcpynA
(
str
,
item
->
text
,
nMaxSiz
);
lstrcpyn
Wto
A
(
str
,
item
->
text
,
nMaxSiz
);
TRACE
(
"returning '%s'
\n
"
,
str
);
return
strlen
(
str
);
}
...
...
@@ -3441,10 +3442,10 @@ INT WINAPI GetMenuStringW( HMENU hMenu, UINT wItemID,
hMenu
,
wItemID
,
str
,
nMaxSiz
,
wFlags
);
if
(
!
(
item
=
MENU_FindItem
(
&
hMenu
,
&
wItemID
,
wFlags
)))
return
0
;
if
(
!
IS_STRING_ITEM
(
item
->
fType
))
return
0
;
if
(
!
str
||
!
nMaxSiz
)
return
strlen
(
item
->
text
);
if
(
!
str
||
!
nMaxSiz
)
return
strlen
W
(
item
->
text
);
str
[
0
]
=
'\0'
;
lstrcpyn
Ato
W
(
str
,
item
->
text
,
nMaxSiz
);
return
l
strlenW
(
str
);
lstrcpynW
(
str
,
item
->
text
,
nMaxSiz
);
return
strlenW
(
str
);
}
...
...
@@ -3573,17 +3574,17 @@ BOOL16 WINAPI InsertMenu16( HMENU16 hMenu, UINT16 pos, UINT16 flags,
/*******************************************************************
* InsertMenu
A (USER32.322
)
* InsertMenu
W (USER32.325
)
*/
BOOL
WINAPI
InsertMenu
A
(
HMENU
hMenu
,
UINT
pos
,
UINT
flags
,
UINT
id
,
LPCSTR
str
)
BOOL
WINAPI
InsertMenu
W
(
HMENU
hMenu
,
UINT
pos
,
UINT
flags
,
UINT
id
,
LPC
W
STR
str
)
{
MENUITEM
*
item
;
if
(
IS_STRING_ITEM
(
flags
)
&&
str
)
TRACE
(
"hMenu %04x, pos %d, flags %08x, "
"id %04x, str '%s'
\n
"
,
hMenu
,
pos
,
flags
,
id
,
str
);
hMenu
,
pos
,
flags
,
id
,
debugstr_w
(
str
)
);
else
TRACE
(
"hMenu %04x, pos %d, flags %08x, "
"id %04x, str %08lx (not a string)
\n
"
,
hMenu
,
pos
,
flags
,
id
,
(
DWORD
)
str
);
...
...
@@ -3605,21 +3606,21 @@ BOOL WINAPI InsertMenuA( HMENU hMenu, UINT pos, UINT flags,
/*******************************************************************
* InsertMenu
W (USER32.325
)
* InsertMenu
A (USER32.322
)
*/
BOOL
WINAPI
InsertMenu
W
(
HMENU
hMenu
,
UINT
pos
,
UINT
flags
,
UINT
id
,
LPC
W
STR
str
)
BOOL
WINAPI
InsertMenu
A
(
HMENU
hMenu
,
UINT
pos
,
UINT
flags
,
UINT
id
,
LPCSTR
str
)
{
BOOL
ret
;
if
(
IS_STRING_ITEM
(
flags
)
&&
str
)
{
LP
STR
newstr
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
str
);
ret
=
InsertMenu
A
(
hMenu
,
pos
,
flags
,
id
,
newstr
);
LP
WSTR
newstr
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
str
);
ret
=
InsertMenu
W
(
hMenu
,
pos
,
flags
,
id
,
newstr
);
HeapFree
(
GetProcessHeap
(),
0
,
newstr
);
return
ret
;
}
else
return
InsertMenu
A
(
hMenu
,
pos
,
flags
,
id
,
(
LPC
STR
)
str
);
else
return
InsertMenu
W
(
hMenu
,
pos
,
flags
,
id
,
(
LPCW
STR
)
str
);
}
...
...
@@ -3734,17 +3735,17 @@ BOOL16 WINAPI ModifyMenu16( HMENU16 hMenu, UINT16 pos, UINT16 flags,
/*******************************************************************
* ModifyMenu
A (USER32.397
)
* ModifyMenu
W (USER32.398
)
*/
BOOL
WINAPI
ModifyMenu
A
(
HMENU
hMenu
,
UINT
pos
,
UINT
flags
,
UINT
id
,
LPCSTR
str
)
BOOL
WINAPI
ModifyMenu
W
(
HMENU
hMenu
,
UINT
pos
,
UINT
flags
,
UINT
id
,
LPC
W
STR
str
)
{
MENUITEM
*
item
;
if
(
IS_STRING_ITEM
(
flags
))
{
TRACE
(
"%04x %d %04x %04x '%s'
\n
"
,
hMenu
,
pos
,
flags
,
id
,
str
?
str
:
"#NULL#"
);
hMenu
,
pos
,
flags
,
id
,
str
?
debugstr_w
(
str
)
:
"#NULL#"
);
if
(
!
str
)
return
FALSE
;
}
else
...
...
@@ -3759,21 +3760,21 @@ BOOL WINAPI ModifyMenuA( HMENU hMenu, UINT pos, UINT flags,
/*******************************************************************
* ModifyMenu
W (USER32.398
)
* ModifyMenu
A (USER32.397
)
*/
BOOL
WINAPI
ModifyMenu
W
(
HMENU
hMenu
,
UINT
pos
,
UINT
flags
,
UINT
id
,
LPC
W
STR
str
)
BOOL
WINAPI
ModifyMenu
A
(
HMENU
hMenu
,
UINT
pos
,
UINT
flags
,
UINT
id
,
LPCSTR
str
)
{
BOOL
ret
;
if
(
IS_STRING_ITEM
(
flags
)
&&
str
)
{
LP
STR
newstr
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
str
);
ret
=
ModifyMenu
A
(
hMenu
,
pos
,
flags
,
id
,
newstr
);
LP
WSTR
newstr
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
str
);
ret
=
ModifyMenu
W
(
hMenu
,
pos
,
flags
,
id
,
newstr
);
HeapFree
(
GetProcessHeap
(),
0
,
newstr
);
return
ret
;
}
else
return
ModifyMenu
A
(
hMenu
,
pos
,
flags
,
id
,
(
LPC
STR
)
str
);
else
return
ModifyMenu
W
(
hMenu
,
pos
,
flags
,
id
,
(
LPCW
STR
)
str
);
}
...
...
@@ -4355,7 +4356,7 @@ BOOL WINAPI IsMenu(HMENU hmenu)
*/
static
BOOL
GetMenuItemInfo_common
(
HMENU
hmenu
,
UINT
item
,
BOOL
bypos
,
LPMENUITEMINFO
A
lpmii
,
BOOL
unicode
)
LPMENUITEMINFO
W
lpmii
,
BOOL
unicode
)
{
MENUITEM
*
menu
=
MENU_FindItem
(
&
hmenu
,
&
item
,
bypos
?
MF_BYPOSITION
:
0
);
...
...
@@ -4369,13 +4370,13 @@ static BOOL GetMenuItemInfo_common ( HMENU hmenu, UINT item, BOOL bypos,
switch
(
MENU_ITEM_TYPE
(
menu
->
fType
))
{
case
MF_STRING
:
if
(
menu
->
text
)
{
int
len
=
strlen
(
menu
->
text
);
int
len
=
strlen
W
(
menu
->
text
);
if
(
lpmii
->
dwTypeData
&&
lpmii
->
cch
)
{
if
(
unicode
)
lstrcpyn
AtoW
((
LPWSTR
)
lpmii
->
dwTypeData
,
menu
->
text
,
lstrcpyn
W
(
lpmii
->
dwTypeData
,
menu
->
text
,
lpmii
->
cch
);
else
lstrcpyn
A
(
lpmii
->
dwTypeData
,
menu
->
text
,
lpmii
->
cch
);
lstrcpyn
WtoA
((
LPSTR
)
lpmii
->
dwTypeData
,
menu
->
text
,
lpmii
->
cch
);
/* if we've copied a substring we return its length */
if
(
lpmii
->
cch
<=
len
)
lpmii
->
cch
--
;
...
...
@@ -4395,12 +4396,12 @@ static BOOL GetMenuItemInfo_common ( HMENU hmenu, UINT item, BOOL bypos,
if
(
lpmii
->
fMask
&
MIIM_STRING
)
{
if
(
lpmii
->
dwTypeData
&&
lpmii
->
cch
)
{
if
(
unicode
)
lstrcpyn
Ato
W
((
LPWSTR
)
lpmii
->
dwTypeData
,
menu
->
text
,
lstrcpynW
((
LPWSTR
)
lpmii
->
dwTypeData
,
menu
->
text
,
lpmii
->
cch
);
else
lstrcpyn
A
(
lpmii
->
dwTypeData
,
menu
->
text
,
lpmii
->
cch
);
lstrcpyn
WtoA
((
LPSTR
)
lpmii
->
dwTypeData
,
menu
->
text
,
lpmii
->
cch
);
}
lpmii
->
cch
=
strlen
(
menu
->
text
);
lpmii
->
cch
=
strlen
W
(
menu
->
text
);
}
if
(
lpmii
->
fMask
&
MIIM_FTYPE
)
...
...
@@ -4434,7 +4435,8 @@ static BOOL GetMenuItemInfo_common ( HMENU hmenu, UINT item, BOOL bypos,
BOOL
WINAPI
GetMenuItemInfoA
(
HMENU
hmenu
,
UINT
item
,
BOOL
bypos
,
LPMENUITEMINFOA
lpmii
)
{
return
GetMenuItemInfo_common
(
hmenu
,
item
,
bypos
,
lpmii
,
FALSE
);
return
GetMenuItemInfo_common
(
hmenu
,
item
,
bypos
,
(
LPMENUITEMINFOW
)
lpmii
,
FALSE
);
}
/**********************************************************************
...
...
@@ -4444,7 +4446,7 @@ BOOL WINAPI GetMenuItemInfoW( HMENU hmenu, UINT item, BOOL bypos,
LPMENUITEMINFOW
lpmii
)
{
return
GetMenuItemInfo_common
(
hmenu
,
item
,
bypos
,
(
LPMENUITEMINFOA
)
lpmii
,
TRUE
);
lpmii
,
TRUE
);
}
/**********************************************************************
...
...
@@ -4452,7 +4454,7 @@ BOOL WINAPI GetMenuItemInfoW( HMENU hmenu, UINT item, BOOL bypos,
*/
static
BOOL
SetMenuItemInfo_common
(
MENUITEM
*
menu
,
const
MENUITEMINFO
A
*
lpmii
,
const
MENUITEMINFO
W
*
lpmii
,
BOOL
unicode
)
{
if
(
!
menu
)
return
FALSE
;
...
...
@@ -4472,9 +4474,9 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
if
(
IS_STRING_ITEM
(
menu
->
fType
)
&&
menu
->
text
)
{
if
(
unicode
)
menu
->
text
=
HEAP_strdupW
toA
(
SystemHeap
,
0
,
(
LPWSTR
)
lpmii
->
dwTypeData
);
menu
->
text
=
HEAP_strdupW
(
SystemHeap
,
0
,
lpmii
->
dwTypeData
);
else
menu
->
text
=
HEAP_strdupA
(
SystemHeap
,
0
,
lpmii
->
dwTypeData
);
menu
->
text
=
HEAP_strdupA
toW
(
SystemHeap
,
0
,
(
LPSTR
)
lpmii
->
dwTypeData
);
}
}
...
...
@@ -4493,9 +4495,9 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
if
(
IS_STRING_ITEM
(
menu
->
fType
)
&&
menu
->
text
)
{
HeapFree
(
SystemHeap
,
0
,
menu
->
text
);
if
(
unicode
)
menu
->
text
=
HEAP_strdupW
toA
(
SystemHeap
,
0
,
(
LPWSTR
)
lpmii
->
dwTypeData
);
menu
->
text
=
HEAP_strdupW
(
SystemHeap
,
0
,
lpmii
->
dwTypeData
);
else
menu
->
text
=
HEAP_strdupA
(
SystemHeap
,
0
,
lpmii
->
dwTypeData
);
menu
->
text
=
HEAP_strdupA
toW
(
SystemHeap
,
0
,
(
LPSTR
)
lpmii
->
dwTypeData
);
}
}
...
...
@@ -4546,7 +4548,7 @@ BOOL WINAPI SetMenuItemInfoA(HMENU hmenu, UINT item, BOOL bypos,
const
MENUITEMINFOA
*
lpmii
)
{
return
SetMenuItemInfo_common
(
MENU_FindItem
(
&
hmenu
,
&
item
,
bypos
?
MF_BYPOSITION
:
0
),
lpmii
,
FALSE
);
(
const
MENUITEMINFOW
*
)
lpmii
,
FALSE
);
}
/**********************************************************************
...
...
@@ -4556,7 +4558,7 @@ BOOL WINAPI SetMenuItemInfoW(HMENU hmenu, UINT item, BOOL bypos,
const
MENUITEMINFOW
*
lpmii
)
{
return
SetMenuItemInfo_common
(
MENU_FindItem
(
&
hmenu
,
&
item
,
bypos
?
MF_BYPOSITION
:
0
),
(
const
MENUITEMINFOA
*
)
lpmii
,
TRUE
);
lpmii
,
TRUE
);
}
/**********************************************************************
...
...
@@ -4683,7 +4685,7 @@ BOOL WINAPI InsertMenuItemA(HMENU hMenu, UINT uItem, BOOL bypos,
const
MENUITEMINFOA
*
lpmii
)
{
MENUITEM
*
item
=
MENU_InsertItem
(
hMenu
,
uItem
,
bypos
?
MF_BYPOSITION
:
0
);
return
SetMenuItemInfo_common
(
item
,
lpmii
,
FALSE
);
return
SetMenuItemInfo_common
(
item
,
(
const
MENUITEMINFOW
*
)
lpmii
,
FALSE
);
}
...
...
@@ -4694,7 +4696,7 @@ BOOL WINAPI InsertMenuItemW(HMENU hMenu, UINT uItem, BOOL bypos,
const
MENUITEMINFOW
*
lpmii
)
{
MENUITEM
*
item
=
MENU_InsertItem
(
hMenu
,
uItem
,
bypos
?
MF_BYPOSITION
:
0
);
return
SetMenuItemInfo_common
(
item
,
(
const
MENUITEMINFOA
*
)
lpmii
,
TRUE
);
return
SetMenuItemInfo_common
(
item
,
lpmii
,
TRUE
);
}
/**********************************************************************
...
...
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