Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reassigning button captions in messagebox() command
Message
From
09/07/1998 04:35:19
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00115284
Message ID:
00115604
Views:
12
>>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 :

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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform