Discussion:
GetSaveFileName on Hebrew OS
(too old to reply)
Gaurav Chandna
2008-12-31 02:46:00 UTC
Permalink
Hi,

Sorry if this has already been asked before but I could not find it using
the search terms that I tried.
I have an English application which invokes GetSaveFileName() when
responding to user input. However on the Hebrew OS the alignment for the UI
should be inverted (i.e. RTL) but instead appears as it would appear in
English (LTR). Notepad behaves as expected. Could this be caused due to the
fact that the title of the dialog is in English for my app?

Gaurav
Mihai N.
2008-12-31 10:45:16 UTC
Permalink
Post by Gaurav Chandna
I have an English application which invokes GetSaveFileName() when
responding to user input. However on the Hebrew OS the alignment for the UI
should be inverted (i.e. RTL) but instead appears as it would appear in
English (LTR). Notepad behaves as expected. Could this be caused due to
the fact that the title of the dialog is in English for my app?
Looks like the standard dialog is affected by SetThreadUILanguage.
But I am not sure if calling SetProcessDefaultLayout( LAYOUT_RTL ) is the
right thing to do, since it might negatively affect other things in
your application.
Since the application is LTR (Left-to-Right), it kind of makes sense that
all the dialogs owned by it are LTR.

I have tried to use a hook (with OFN_ENABLEHOOK) and add the
(WS_EX_LAYOUTRTL | WS_EX_RTLREADING) window style(ex)
The dialog becomes RTL (title on right and so on), the file list becomes RTL,
but the rest of the controls remain LTR.
--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Gaurav Chandna
2009-01-02 23:27:01 UTC
Permalink
Thank you - just the information I was looking for.

Gaurav
Post by Mihai N.
Post by Gaurav Chandna
I have an English application which invokes GetSaveFileName() when
responding to user input. However on the Hebrew OS the alignment for the UI
should be inverted (i.e. RTL) but instead appears as it would appear in
English (LTR). Notepad behaves as expected. Could this be caused due to
the fact that the title of the dialog is in English for my app?
Looks like the standard dialog is affected by SetThreadUILanguage.
But I am not sure if calling SetProcessDefaultLayout( LAYOUT_RTL ) is the
right thing to do, since it might negatively affect other things in
your application.
Since the application is LTR (Left-to-Right), it kind of makes sense that
all the dialogs owned by it are LTR.
I have tried to use a hook (with OFN_ENABLEHOOK) and add the
(WS_EX_LAYOUTRTL | WS_EX_RTLREADING) window style(ex)
The dialog becomes RTL (title on right and so on), the file list becomes RTL,
but the rest of the controls remain LTR.
--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Mihai N.
2009-01-03 02:45:52 UTC
Permalink
Post by Gaurav Chandna
Thank you - just the information I was looking for.
For everybody's benefit (mine and others): what is the part
that was usefull? What was your decision?

Because I don't feel like any of the things I have put there is a
decent solution. (SetThreadUILanguage will mess up other things
in your app, you will probably discover them when you do a complete
testing, and the hook does only a partial mirroring).

So probably the only decent answer would be "accept that the standard
dialog will be LTR, same as your application".

Is this what you decided?
--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Gaurav Chandna
2009-01-08 06:21:01 UTC
Permalink
Hi,

Sorry for the late reply - didn't realize that the topic was still open.

Actually, before I posted this question I had no idea that you could set
language on a per thread basis etc. So with your initial reply I was pointed
in the correct area of MSDN and therefore was able to ask the relevant
questions which turned to be that the product was not being localized in the
RTL language (only the box was).

Ofcourse all of this confusion would have been avoided if QA team was not
sitting offshore and the localization team was not sitting in a different
continent or if I had some decent screenshots :)

Hope this explains everything.

Gaurav

Hope that ans
Post by Mihai N.
Post by Gaurav Chandna
Thank you - just the information I was looking for.
For everybody's benefit (mine and others): what is the part
that was usefull? What was your decision?
Because I don't feel like any of the things I have put there is a
decent solution. (SetThreadUILanguage will mess up other things
in your app, you will probably discover them when you do a complete
testing, and the hook does only a partial mirroring).
So probably the only decent answer would be "accept that the standard
dialog will be LTR, same as your application".
Is this what you decided?
--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Mihai N.
2009-01-09 03:29:10 UTC
Permalink
Post by Gaurav Chandna
Sorry for the late reply - didn't realize that the topic was still open.
No problem.

Like most things on Internet, these threads never die.
They get mirrored, cached, indexed, migrated to html...
And sometime some guy looking for an answer might stumble
on such a thread and get a solution, maybe 5 years from now
:-)

So it is not critical to be fast, but it is nice to have a closure.
--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Re: GetSaveFileName on Hebrew OS
2009-12-17 07:17:01 UTC
Permalink
Hi All,

I met the same problem, please tell me the solution, many thanks.

Now I call SetProcessDefaultLayout( LAYOUT_RTL), the main window is mirror
(it is ok), but the system dialog (call GetSaveFileName) is not mirror.
Post by Mihai N.
Post by Gaurav Chandna
Sorry for the late reply - didn't realize that the topic was still open.
No problem.
Like most things on Internet, these threads never die.
They get mirrored, cached, indexed, migrated to html...
And sometime some guy looking for an answer might stumble
on such a thread and get a solution, maybe 5 years from now
:-)
So it is not critical to be fast, but it is nice to have a closure.
--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Loading...