summaryrefslogtreecommitdiff
path: root/src/w32menu.c
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2005-08-31 15:22:15 +0000
committerJason Rumney <jasonr@gnu.org>2005-08-31 15:22:15 +0000
commitd749b6fa2137756b292cf35fceafb80c15e89982 (patch)
tree7f6dc9e482c3aba3f160b769074466be1234e596 /src/w32menu.c
parent6bcc3ca4785d24f527fbf3fbae4e4178966915fa (diff)
downloademacs-d749b6fa2137756b292cf35fceafb80c15e89982.tar.gz
(add_menu_item): If unicode_append_menu returns an
error, revert to using AppendMenu.
Diffstat (limited to 'src/w32menu.c')
-rw-r--r--src/w32menu.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/w32menu.c b/src/w32menu.c
index 75c55ef4f85..d441d14b259 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -2321,7 +2321,23 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
item != NULL ? (UINT) item
: (UINT) wv->call_data,
utf16_string);
- if (fuFlags & MF_OWNERDRAW)
+ if (!return_value)
+ {
+ /* On W9x/ME, unicode menus are not supported, though AppendMenuW
+ apparently does exist at least in some cases and appears to be
+ stubbed out to do nothing. out_string is UTF-8, but since
+ our standard menus are in English and this is only going to
+ happen the first time a menu is used, the encoding is
+ of minor importance compared with menus not working at all. */
+ return_value =
+ AppendMenu (menu, fuFlags,
+ item != NULL ? (UINT) item: (UINT) wv->call_data,
+ out_string);
+ /* Don't use unicode menus in future. */
+ unicode_append_menu = NULL;
+ }
+
+ if (unicode_append_menu && (fuFlags & MF_OWNERDRAW))
local_free (out_string);
}
else