Internationalizing menus using MFC support for Unicode
Posted
by Bayram Kuliyev
on July 23rd, 2001
This simple SDI Notepad-like application demonstrates how, taking advantage of the MFC support for Unicode, to Turkmenize labels of the specified menu items. Actually, Turkmen is not supported by Windows 2000, therefore, to create such resources as menu so that strings in Turkmen could be displayed I had to invent an additional technique.
void CMainFrame::ModifyMenu(CMenu* pMenu)
{
UINT nPosition;
UINT nCount;
CString string;
nCount = pMenu->GetMenuItemCount();
for (nPosition = 0; nPosition < nCount; nPosition++)
{
pMenu->GetMenuString(nPosition,string,MF_BYPOSITION);
if(string.IsEmpty())
continue;
string.Replace(SMALL_X, Small_S_cedilla[0]);
string.Replace(CAPITAL_X, Capital_S_cedilla[0]);
string.Replace(SMALL_Q, Capital_N_caron[0]);
pMenu->ModifyMenu(nPosition,MF_BYPOSITION|MF_STRING,
pMenu->GetMenuItemID(nPosition),string);
//recursive call
if(pMenu->GetSubMenu(nPosition))
ModifyMenu(pMenu->GetSubMenu(nPosition));
}
}
Downloads
Download demo project - 48 KbDownload source - 288 Kb

Comments
RTL strings
Posted by Legacy on 03/03/2003 12:00amOriginally posted by: Deepak
HI,
Do you know how to display the Hebrew/Arabic Strings on a owner drawn button controls. I have string 23 x 15 mm, but when I call a ExtTextOut to display the above string, it comes as a inches mm 15 23 on a button control.
DO you ever face this problem.
Regards
Replydk
Can program run on Win98
Posted by Legacy on 12/07/2001 12:00amOriginally posted by: NGUYEN HUU HOA
This code is only implement on Win2000 environment. Can it run on Win98?
Reply