PRB: Only One Language Can Be Used on MessageBoxEx Pushbuttons

Last reviewed: January 15, 1998
Article ID: Q152670
4.00    | 3.51
WINDOWS | WINDOWS NT kbprg

The information in this article applies to:

  - Microsoft Win32 Software Development Kit for:
    - Microsoft Windows NT, version 3.51
    - Microsoft Windows 95, version 4.0

STMPTOMS

When MessageBoxEx is called, regardless of the value of wLanguageID (the last parameter of MessageBoxEx), the pushbutton text can only be displayed in the native language of the operating system.

On Windows NT, if the wLanguageID is the native language ID of the operating system or the wLanguageID is MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), the pushbutton text is displayed in the native language of that version of NT. Otherwise, the pushbuttons are blank.

For example, on US Windows NT 3.51:

   MessageBoxEx( hWnd, "string", "title", MB_RETRYCANCEL,
         MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));

would display a MessageBox with two buttons reading: "retry" and "cancel."

However, on the same operating system:

   MessageBoxEx( hWnd, "string", "title", MB_RETRYCANCEL,
         MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH));

would display a MessageBox with two blank buttons.

On Windows 95, regardless of what is specified in wLanguageID, the pushbutton text is in the native language of that version of Windows 95. For example, on US Windows 95, both:

   MessageBoxEx( hWnd, "string", "title", MB_RETRYCANCEL,
         MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));

   -and-

   MessageBoxEx( hWnd, "string", "title", MB_RETRYCANCEL,
         MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH));

would display a Message Box with two buttons reading: "retry" and "cancel."

STATUS

This behavior is by design.


Additional reference words: 3.51 4.00 resource NLS
KBCategory: kbprg
KBSubcategory: KBIntlDev
Keywords : KBIntlDev kbprg
Version : 4.00 | 3.51
Platform : NT WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 15, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.