Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reassigning button captions in messagebox() command
Message
From
09/07/1998 06:57:08
 
 
To
09/07/1998 04:35:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00115284
Message ID:
00115631
Views:
10
>>>Is there any way to easily reassign the button captions on the messagebox() form? (i.e. reassign the "YES" and "NO" buttons to read "ONE" and "ALL")
>>
>>Using VFP's native MESSAGEBOX(), no. Using the Win32 API call MessageBoxEx(), yes. It's probably just as easy to create a modal form to do the job instead of MESSAGEBOX()
>
>Ed,
>
>Have you ever tried to re-assign the captions, Ed ? I did, and I never succeeded. When I faced the problem, I got in touch with Microsoft's support and this is what I found in the Support KnowledgeBase :

I haven't myself, however, we do use MessageBoxEx() in a couple of apps at work with custom locales that we've defined for use in our international products (Pitney Bowes sells shipping systems all over the place, and the international dev group has very similar support issues to yours. Their approach to the problem has been to create and install custom locales for multilingual country support; I don't work in that group, but can probably get you a contact there to find out exactly what they do.)

My understanding is that for MessageBoxEx(), wLanguageID can only take the values of locales that are listed by EnumSystemLocales() with the LCID_INSTALLED flag for the native system language ID. The macro MAKELANG() with the Primary language ID LANG_NEUTRAL and any of the three system-supported sublanguage identifiers (SUBLANG_NEUTRAL, SUBLANG_DEFAULT and SUBLANG_SYS_DEFAULT) are always safe.

>
>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.
>
>
>
>I actually confirm that this is well the bahavior that I habe observed so far. Of course everybody's wondering why the language ID can be set ... if the official answer of Microsoft is : "This behavior is by design".
>
>If you have any solution, Ed, I would be delighted to get it because, I really need this functionality to work in the programs I am writing ... you see, in Belgium, we deal with three national languages, Dutch, French and German. Of course, the use wants to receive the messages in his mother language, whatever version of Windows he's using, English, Dutch, German, French or ...
>
>Pat
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform