diff options
| author | Jason Rumney | 2005-08-31 15:22:15 +0000 |
|---|---|---|
| committer | Jason Rumney | 2005-08-31 15:22:15 +0000 |
| commit | d749b6fa2137756b292cf35fceafb80c15e89982 (patch) | |
| tree | 7f6dc9e482c3aba3f160b769074466be1234e596 /src | |
| parent | 6bcc3ca4785d24f527fbf3fbae4e4178966915fa (diff) | |
| download | emacs-d749b6fa2137756b292cf35fceafb80c15e89982.tar.gz emacs-d749b6fa2137756b292cf35fceafb80c15e89982.zip | |
(add_menu_item): If unicode_append_menu returns an
error, revert to using AppendMenu.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32menu.c | 18 |
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) | |||
| 2321 | item != NULL ? (UINT) item | 2321 | item != NULL ? (UINT) item |
| 2322 | : (UINT) wv->call_data, | 2322 | : (UINT) wv->call_data, |
| 2323 | utf16_string); | 2323 | utf16_string); |
| 2324 | if (fuFlags & MF_OWNERDRAW) | 2324 | if (!return_value) |
| 2325 | { | ||
| 2326 | /* On W9x/ME, unicode menus are not supported, though AppendMenuW | ||
| 2327 | apparently does exist at least in some cases and appears to be | ||
| 2328 | stubbed out to do nothing. out_string is UTF-8, but since | ||
| 2329 | our standard menus are in English and this is only going to | ||
| 2330 | happen the first time a menu is used, the encoding is | ||
| 2331 | of minor importance compared with menus not working at all. */ | ||
| 2332 | return_value = | ||
| 2333 | AppendMenu (menu, fuFlags, | ||
| 2334 | item != NULL ? (UINT) item: (UINT) wv->call_data, | ||
| 2335 | out_string); | ||
| 2336 | /* Don't use unicode menus in future. */ | ||
| 2337 | unicode_append_menu = NULL; | ||
| 2338 | } | ||
| 2339 | |||
| 2340 | if (unicode_append_menu && (fuFlags & MF_OWNERDRAW)) | ||
| 2325 | local_free (out_string); | 2341 | local_free (out_string); |
| 2326 | } | 2342 | } |
| 2327 | else | 2343 | else |