# HG changeset patch # User Jason Rumney # Date 1125501735 0 # Node ID c0c0b5bf96ab91cf0c168d0f40f85d92a706f76f # Parent 6a6c73b4d33754204e7939555a9049fa9aa64fe8 (add_menu_item): If unicode_append_menu returns an error, revert to using AppendMenu. diff -r 6a6c73b4d337 -r c0c0b5bf96ab src/w32menu.c --- a/src/w32menu.c Wed Aug 31 15:20:46 2005 +0000 +++ b/src/w32menu.c Wed Aug 31 15:22:15 2005 +0000 @@ -2321,7 +2321,23 @@ 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