> Shouldn't it automatically change to RTL if I change the locale to Hebrew?
And "change the locale to Hebrew" is too vague.
You can set the thread locale, user locale, system locale, UI locale, input
locale.
And, anyway, the answer is no. Because then all applications, localized into
Hebrew or not, will be RTL.
I know there is a constant MB_RTLREADING or osmething, but I cannot
use that as the program has to run in a number of different languages.
MB_RTLREADING is the solution. And you can use it.
Just write a wrapper function.
Transform this:
MessageBox( hwnd, text, title, flags );
into this:
MessageBox( hwnd, text, title, AdjustRTLFlags(flags) );
And your AdjustRTLFlags can do something like this:
UINT AdjustRTLFlags( UINT flags ) {
static int nIsRTL = -1;
switch( bIsRTL ) {
case -1:
bIsRTL = GetRTL();
break;
case 0:
flags &= ~MB_RTLREADING;
break;
case 1:
flags |= MB_RTLREADING;
break;
default:
assert(1);
}
return flags;
}
GetRTL() can get the RTL setting from resources, registry, etc.
Or you can global search-replace MessageBox with MessageBoxSmartRTL, and
MessageBoxSmartRTL does the same "magic" as the function above.
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email