473,738 Members | 11,146 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MessageBox displaying text LTR in Hebrew environment


I have a program which runs in multiple languages. The problem is that
message boxes displayed when I run my program on Hebrew still have
left-to-right reading order. This is Hebrew locale on an English Windows
machine. 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.
Shouldn't it automatically change to RTL if I change the locale to Hebrew?
Any ideas/suggestions would be most welcome.

Thanks.

-Jaya
Jan 17 '06 #1
4 2242
Hi Jaya!
I have a program which runs in multiple languages. The problem is that
message boxes displayed when I run my program on Hebrew still have
left-to-right reading order.


Normally the text is displayed correctly even on an english windows!
Are you really sure that the text is in the right order?

A better newgroup might also be:
microsoft.publi c.dotnet.intern ationalization

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Jan 17 '06 #2
> 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 MessageBoxSmart RTL, and
MessageBoxSmart RTL 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
Jan 18 '06 #3
Jaya wrote:
I have a program which runs in multiple languages. The problem is that
message boxes displayed when I run my program on Hebrew still have
left-to-right reading order. This is Hebrew locale on an English Windows
machine. 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.
Shouldn't it automatically change to RTL if I change the locale to Hebrew?
Any ideas/suggestions would be most welcome.


To get Hebrew to work in English Windows, you need to go Control
Panel->Regional and Language Options->Languages Tab->Tick install files
for complex script and right-to-left languages (including Thai). Once
you've done that, the APIs work fine.

Tom
Jan 18 '06 #4
Hi Jaya!
I have a program which runs in multiple languages. The problem is that
message boxes displayed when I run my program on Hebrew still have
left-to-right reading order. This is Hebrew locale on an English Windows
machine. 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.
Shouldn't it automatically change to RTL if I change the locale to Hebrew?
Any ideas/suggestions would be most welcome.


I think Michael S. Kaplan has read this post and added a blog-entry
about this:

See: Just when you think you know a function...
http://blogs.msdn.com/michkap/archiv...19/514656.aspx

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Jan 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
541
by: Rich Tasker | last post by:
I have a strange situation. A simple call to MessageBox.Show("XXX", "YYY") does not display the message in the messagebox with a visible font. Based on the content of the messagebox, the box sizes properly so I know there is a message in there. I also found a keyboard shortcut where <ctrl>+<insert> will copy the contents of the messagebox to the clipboard in plain text. I see my messagebox text in the clipboard contents but not in the...
1
2270
by: Yoshitha | last post by:
hi I have datalist control in my ASP.NET application the problem here is i have used a textbox with multiline true propertly when i enter data like "fdjsfhjksdhfjsdfhsdjhfsdfhsdjfhsd jfdsjfksdjfksdjkfjsdfjksdjfsdjfd fdsfhjsdhfjsdhfjf dsjf dsjfhjsdfhjksdh d fdsjf hsdjkfhdjsfhsdjfh ds
1
4059
by: kannan | last post by:
hi, It might be the simple question. I am concatinating two string and displaying in messagebox. Ex: MessageBox.show(string.Concat("The following validation(s) failed:\n", arg.DisplayMessage)) But I have overloaded my messageBox for my project style. When the message is displayed it is displaying one special charcter in
3
7427
by: Sin | last post by:
I'm currently evaluating VC.NET as the new platform for the company I work for and things are looking grim... We're up against another IDE which took me about 5 minutes to master and I've been bitching at .NET for the whole day now not being able to do something as simple as showing a textbox's content in a damn MessageBox... The TextBox.Text is a String... MessageBox takes a LPCSTR (plain single byte char*)... All our current code base...
0
1651
by: Gidi | last post by:
Hi, i'm writing this question again, since i didn't get an answer in the reply i wrote, i hope it's ok. My user default language is hebrew and in some specific TextBoxs i want that the default language will be english. I asked here and the answer i got was that the best way to do so, is by getting the Hebrew Letter and Change it to it's parallel English letter on the keyboard. i didn't such a function (with switch and case) but i'm...
20
8907
by: Peter E. Granger | last post by:
I'm having a strange problem (or at least it seems strange to me) trying to display a MessageBox in a VC++ .NET forms application. If I put the call to MessageBox::Show in the form's .h file, it works just fine. If I put the call in the .cpp file, I get the following two errors: error C2653: 'MessageBoxA': is not a class or namespace name error C2660: 'System::Windows::Forms::Control::Show': function does not take
0
1023
by: Eitan | last post by:
Hello, I have a ValidationSummary. My language is Hebrew. How can I control ValidationSummary, so it will fits the language Hebrew. (It should be read as dir="rtl" / right to left reading. Can I handle what is the contents of the header of validationSummary ?) Thanks :)
2
3306
by: Asaf | last post by:
Hi, Below is a calss with function I gathered from a news group that uses GetCharacterPlacement API to reorder text. I have mixed text Hebrew/English and the function reorders the Hebrew text. I would like to reorder the English text instead the Hebrew text. How can I do that please?
16
5509
by: Al Santino | last post by:
Hi, It appears displaying a messagebox in a validating event will cancel the subsequent event. In the program below, button 2's click event doesn't fire if you open a dialog box in button 1's validating event. Am I doing something wrong here? Thanks Al Imports system
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.