Re: надписи на кнопках в MessageBox
От: Sinatr Германия  
Дата: 23.04.03 11:33
Оценка: 7 (2)
Привет!

SL>Есть диалговое окно MessageBox, в нем содержатся описание собыия и некоторые инструкции для пользователя, что делать. Что-то вроде "если так, то нажмите "ДА" иначе нажмите "НЕТ"". Возникла проблема, если программа запусакется в анлгийских Windows, то при установленном флаге MB_YESNO, кнопки называются не 'Да' и 'Нет', а 'Yes' и 'No'. Можно конечно получить значение LOCALEID, и хранить два варианта инструкций, но может можно как-нибудь получить из ресурсов что-ли эти 'Yes', 'No' и т.д. ?


Юзать надо MessageBoxEx():

int MessageBoxEx(
HWND hWnd, // handle of owner window
LPCTSTR lpText, // address of text in message box
LPCTSTR lpCaption, // address of title of message box
UINT uType, // style of message box
WORD wLanguageId // language identifier
);


wLanguageId

Specifies the language in which to display the text contained in the predefined push buttons. This value must be in the form returned by the MAKELANGID macro.
For a list of the language identifiers supported by Win32, see Language Identifiers. Note that each localized release of Windows typically contains resources only for a limited set of languages. Thus, for example, the U.S. version offers LANG_ENGLISH, the French version offers LANG_FRENCH, the German version offers LANG_GERMAN, and the Japanese version offers LANG_JAPANESE. Each version offers LANG_NEUTRAL. This limits the set of values that can be used with the wLanguageId parameter. Before specifying a language identifier, you should enumerate the locales that are installed on a system.


Вот этот самый wLanguageId и задает язык. Он делается макрой:

WORD MAKELANGID(
USHORT usPrimaryLanguage, // primary language identifier
USHORT usSubLanguage // sublanguage identifier
);

Тут у тебя usPrimaryLanguage=LANG_RUSSIAN, а usSubLanguage=SUBLANG_NEUTRAL, и вроде бы должно работать..
---
ПроГLамеры объединяйтесь..
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.