Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button texts on a MessageBox

Status
Not open for further replies.

Dragonsoft

Programmer
Jan 2, 2002
9
SE
Im using API MessageBox functions.
When i call it i have a message text like this( only for example not for real):
"Have a problem? Do do it again press Retry and to Exit press Cancel."

and have given the function Window- constants MB_RETRYCANCEL for example.
This displays a Message box with two buttons "Retry" and "Cancel".

The problem is when i run the app on an WinXP Swedish desktop the button texts is dynamicly changed to Swedish texts of "Retry" to "Försök Igen" and "Cancel" to "Avbryt".
This is not the texts i have in my constant text above.
Where and how can i get the buttontexts from the API to show the users the correct button texts in my string constant?

Best regards
/Olle


"Some thoughts has a certain sound..."
 
----------
You can make some tricks like firing a message box with multiple buttons to get and store the buttons text when you program starts.

You need to identify the box, then the buttons into the box, then you need the buttons handles and at this point you can use GetText to get the strings.

I believe we have a lot of messages here in the forum about how to identify running objects and get their handles.
----------

But basically this is not the way Windows localization works, as presenting the user with a text saying "Have a problem? To do it again press Försök Igen and to exit press Avbryt." solves little.

If the user can not understand english to the point of not realize that Cancel is Avbryt he is unable to understand the whole message anyway.

Now, in some cases the problem is not the user not knowing english but the user being computer illiterated, and in such cases your approach can work... but Windows is not suited for solutions like this.

The better solution is localizing your entire messages, not only the control names.

buho (A).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top