Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MS Shell Dlg 2: Am I the only one who can't seem to use it AT ALL?

159 views
Skip to first unread message

neel...@rediffmail.com

unread,
Jun 14, 2007, 8:12:46 AM6/14/07
to
Hi,

I am running my app on Japanese system and want windows to use "MS
Shell Dlg 2" in my property sheet. Following is the rc file text for
one of my property pages -

IDD_PAGE_MY_PAGE DIALOGEX 0, 0, 348, 172
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "My Page"
FONT 9, "MS Shell Dlg 2", 400, 0, 0x1
BEGIN
LTEXT "This is where TAHOMA should be used..",
IDC_MY_CTRL,123,65,216,48
END

Oberservations:
1) On the japanese system where I am running this property sheet, OS
is Windows XP Pro SP2
2) Registry key "FontSubstitutes" translates MS Shell Dlg to "MS UI
Gothic" and MS Shell Dlg to "Tahoma"
3) I have tried all the permutations/combinations with the resource
script -
a) specified "MS Shell Dlg" instead of "MS Shell Dlg 2" (according
to MS, it should automatically get translated to "Tahoma")
b) Used DS_SHELLFONT (although DS_SHELLFONT = DS_SETFONT|
DS_FIXEDSYS)
c) specified "Tahoma" after removing DS_SETFONT and DS_FIXEDSYS

In ALL the cases I get "MS UI Gothic" as font when I get the face name
using following code in CMyPage::OnInitDialog -
CString cs;
LOGFONT logfont;
GetDlgItem(IDC_MY_CTRL)->GetFont()->GetLogFont(&logfont);
cs.Format(_T("Face Name = %s Height = %d"),logfont.lfFaceName,
logfont.lfHeight);
MessageBox(cs);

I can set the "MS Shell Dlg 2" programmatically but then I will have
to do that for EVERY page.

Any idea how I can make windows use MS Shell Dlg 2 (Tahoma)? Any help
will be appreciated.

Thanks in advance,
Neel.

Michael S. Kaplan [MSFT]

unread,
Jun 14, 2007, 8:29:28 AM6/14/07
to
If you want to always use Tahoma even when the system does not agree, why
not just USE Tahoma and be done with it?


--
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.


<neel...@rediffmail.com> wrote in message
news:1181823166.6...@a26g2000pre.googlegroups.com...

Norman Diamond

unread,
Jun 14, 2007, 8:32:44 PM6/14/07
to
"Michael S. Kaplan [MSFT]" <mic...@online.microsoft.com> wrote in message
news:em4mK%23nrHH...@TK2MSFTNGP03.phx.gbl...

> <neel...@rediffmail.com> wrote in message
> news:1181823166.6...@a26g2000pre.googlegroups.com...
>>
>> I am running my app on Japanese system and want windows to use "MS Shell
>> Dlg 2" in my property sheet.

Are you absolutely sure you want to do that? You will never display any
text received from the OS or the user, such as a filename or username or
built-in group name or error message text or device name or anything like
that? You will display 100% text that you're writing?

>> 1) On the japanese system where I am running this property sheet, OS is
>> Windows XP Pro SP2
>> 2) Registry key "FontSubstitutes" translates MS Shell Dlg to "MS UI
>> Gothic" and MS Shell Dlg to "Tahoma"

I think your second MS Shell Dlg is a typo for MS Shell Dlg 2. In that case
it matches my system. Fortunately my system doesn't really use Tahoma for
most text. At the moment I'm too lazy to look up documentation for MS Shell
Dlg 2 and try to figure out if it's accurate, sorry.

>> 3) I have tried all the permutations/combinations with the resource
>> script -
>> a) specified "MS Shell Dlg" instead of "MS Shell Dlg 2" (according to
>> MS, it should automatically get translated to "Tahoma")

I've seen MSDN documentation that MS Shell Dlg will automatically get
translated to Tahoma. In my experience about 75% of MSDN is accurate. In
this particular case it's very fortunate that this garbage is in the other
25%.

>> b) Used DS_SHELLFONT (although DS_SHELLFONT = DS_SETFONT | DS_FIXEDSYS)
>> c) specified "Tahoma" after removing DS_SETFONT and DS_FIXEDSYS
>> In ALL the cases I get "MS UI Gothic"

Your users are lucky. Windows is doing undocumented underhanded hacks in
order to work around your code so that users can see their text.


> If you want to always use Tahoma even when the system does not agree, why
> not just USE Tahoma and be done with it?

> This posting is provided "AS IS" with
> no warranties, and confers no rights.

Well, the original poster said in step c) that he tried to USE Tahoma and be
done with it, but Windows didn't accept it. For users that is fortunate,
but for programmers it would be better if MSDN would be changed to match.

neel...@rediffmail.com

unread,
Jun 15, 2007, 6:06:20 AM6/15/07
to
Thanks for the reply.

On Jun 15, 5:32 am, "Norman Diamond" <ndiam...@community.nospam>
wrote:


> "Michael S. Kaplan [MSFT]" <mic...@online.microsoft.com> wrote in messagenews:em4mK%23nrHH...@TK2MSFTNGP03.phx.gbl...

> Are you absolutely sure you want to do that? You will never display any


> text received from the OS or the user, such as a filename or username or
> built-in group name or error message text or device name or anything like
> that? You will display 100% text that you're writing?

Not sure what this means but yes, I want user to be able to enter the
text and all the things that you have mentioned. I believe Tahoma can
display that. Am I wrong or I got the meaning wrong?

> I think your second MS Shell Dlg is a typo for MS Shell Dlg 2.

Yep.

> Your users are lucky. Windows is doing undocumented underhanded hacks in
> order to work around your code so that users can see their text.

Didn't understand this either.

My problem is MS UI Gothic has really less vertical and horizontal
leading. Tahoma has much better. That's the reason for trying to
change the fonts.

Thanks,
Neel.

Michael S. Kaplan [MSFT]

unread,
Jun 15, 2007, 10:43:02 AM6/15/07
to
Tahoma itself cannot, but it is linked via GDI to get to other fonts.

However, for Japanese the native speakers have gone in a different
direction, believing this to not be the best practice. Ignoring Norman's
diatribe, the behavior you are seeing is by design and, expected.

If you do not want to trust Microsoft's data on this, then that is fine (and
I am not even saying I disagree with you). But the bottom line is that using
ANYTHING along the lines of shell dialog fonts or shell fonts is an implicit
statement of trust for the data you did not want to go with (thus you have
been fighting with your own preferences here!).

Windows is NOT doing hacky things in this case.


--
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with


no warranties, and confers no rights.


<neel...@rediffmail.com> wrote in message
news:1181901980.8...@x35g2000prf.googlegroups.com...

Norman Diamond

unread,
Jun 17, 2007, 8:35:12 PM6/17/07
to
<neel...@rediffmail.com> wrote in message
news:1181901980.8...@x35g2000prf.googlegroups.com...

> On Jun 15, 5:32 am, "Norman Diamond" <ndiam...@community.nospam>
> wrote:
>>
>> Are you absolutely sure you want to do that? You will never display any
>> text received from the OS or the user, such as a filename or username or
>> built-in group name or error message text or device name or anything like
>> that? You will display 100% text that you're writing?
>
> Not sure what this means but yes, I want user to be able to enter the text
> and all the things that you have mentioned.

Then you don't mean yes, you mean no. You aren't absolutely sure that you
want to prevent display of most characters. You want to display text
received from the OS or from the user. You will not display 100% text that
you're writing.

> I believe Tahoma can display that. Am I wrong or I got the meaning wrong?

Tahoma cannot display most of the characters that are used in the world. If
you want to display the user's characters, you're lucky that Windows didn't
obey you when you obeyed MSDN.

Aside to Michael Kaplan: You're right about my diatribe. I retract it.
MSDN absolutely should not be modified to document the actual behaviour of
Windows. That would make MSDN too confusing.

Michael S. Kaplan [MSFT]

unread,
Jun 17, 2007, 9:00:26 PM6/17/07
to
"Norman Diamond" <ndia...@community.nospam> wrote...

> Aside to Michael Kaplan: You're right about my diatribe. I retract it.
> MSDN absolutely should not be modified to document the actual behaviour of
> Windows. That would make MSDN too confusing.

Funny how one can call me absolutely right at the sane time as one says
something different than I was saying.

Ah well, that's how these threads seem to go.

MichKa [MS]


Norman Diamond

unread,
Jun 17, 2007, 9:46:22 PM6/17/07
to
"Michael S. Kaplan [MSFT]" <mic...@online.microsoft.com> wrote in message
news:%23OamvPU...@TK2MSFTNGP03.phx.gbl...

> "Norman Diamond" <ndia...@community.nospam> wrote...
>
>> Aside to Michael Kaplan: You're right about my diatribe. I retract it.
>> MSDN absolutely should not be modified to document the actual behaviour
>> of Windows. That would make MSDN too confusing.
>
> Funny how one can call me absolutely right at the sane time as one says
> something different than I was saying.

You called my diatribe a diatribe. I agreed, I retracted my diatribe, and
explained.

Michael S. Kaplan [MSFT]

unread,
Jun 17, 2007, 11:31:32 PM6/17/07
to
Sigh.... never mind, Norman. Carry on.

MichKa [MS]

"Norman Diamond" <ndia...@community.nospam> wrote in message
news:ee9Y%23pUsH...@TK2MSFTNGP04.phx.gbl...

neel...@rediffmail.com

unread,
Jun 18, 2007, 3:04:12 AM6/18/07
to
>
> "Norman Diamond" <ndiam...@community.nospam> wrote in message
>
> news:ee9Y%23pUsH...@TK2MSFTNGP04.phx.gbl...
>

> Tahoma cannot display most of the characters that are used in the world. If
> you want to display the user's characters, you're lucky that Windows didn't
> obey you when you obeyed MSDN.

I thought it could and that's the reason why MS Shell Dlg 2 on
Japanese Windows version translates to Tahoma, otherwise, what's the
use?

Assuming that I cannot use anything other than MS Shell Dlg, the ONLY
way is to somehow ask windows to use better leading for MS Shell Dlg
(MS UI Gothic)? And if yes, how do I do that since actual font setting
happens somewhere in MFC? Have a custom base dialog class for all
pages, handle WM_SETFONT and change the leading or is there a better
way?

Thanks,
Neel.

Norman Diamond

unread,
Jun 18, 2007, 4:57:20 AM6/18/07
to
<neel...@rediffmail.com> wrote in message
news:1182150252.2...@i38g2000prf.googlegroups.com...

> "Norman Diamond" <ndiam...@community.nospam> wrote in message
> news:ee9Y%23pUsH...@TK2MSFTNGP04.phx.gbl...
>>
>> Tahoma cannot display most of the characters that are used in the world.
>> If you want to display the user's characters, you're lucky that Windows
>> didn't obey you when you obeyed MSDN.
>
> I thought it could and that's the reason why MS Shell Dlg 2 on Japanese
> Windows version translates to Tahoma, otherwise, what's the use?

It can't and that's why Japanese Windows uses MS UI Gothic (except that
Japanese Vista uses Meiryo around half the time). The purpose of using MS
UI Gothic (or Meiryo) is so that Japanese characters can be displayed.

> Assuming that I cannot use anything other than MS Shell Dlg, the ONLY way
> is to somehow ask windows to use better leading for MS Shell Dlg (MS UI
> Gothic)?

When you ask for MS Shell Dlg, Windows chooses MS UI Gothic, so you and your
customers win. Your customers get to see their own characters, plus a few
thousand characters that have been imported from China during recent
millennia, plus a few hundred characters that have been imported from Italy
and other places during recent centuries. Why do you dislike this result?

neel...@rediffmail.com

unread,
Jun 18, 2007, 5:52:46 AM6/18/07
to
Thanks for the reply Norman.

On Jun 18, 1:57 pm, "Norman Diamond" <ndiam...@community.nospam>
wrote:

> ...and other places during recent centuries. Why do you dislike this result?
The only reason is that, vertical and horizontal leading space for MS
UI Gothic is really less. So two characters in same line or line below
almost seem to touch each other. Tahoma has a better leading space
scheme but as you say it can't display all characters in Japanese so I
can't use it. Now the question is, is there a way to ask windows to
increase leading space in MS UI Gothic without having to
programmatically do it for every page. Or is it that I am missing some
important point about leading (vertical & horizontal) spaces?

Thanks,
Neel.

Norman Diamond

unread,
Jun 18, 2007, 7:17:28 AM6/18/07
to
<neel...@rediffmail.com> wrote in message
news:1182160366....@x35g2000prf.googlegroups.com...

> On Jun 18, 1:57 pm, "Norman Diamond" <ndiam...@community.nospam> wrote:
>> ...and other places during recent centuries. Why do you dislike this
>> result?
>
> The only reason is that, vertical and horizontal leading space for MS UI
> Gothic is really less. So two characters in same line or line below almost
> seem to touch each other.

Oh I think I understand now. You didn't know that Japanese (and I think
Chinese and Korean) in ordinary Windows applications are usually displayed
in 9-point fonts. Maybe you did some computations for 8-point fonts, but
the actual character sizes are 9 points, so your application is squeezing
them too close together. There are two possible solutions for this.

(1) If you want to insist on 8-point fonts, then you force the selected
font to be 8 points.

(2) If you can do computations using the user's fonts (either Windows
default fonts or the user's selected fonts) then you call an API to get the
font size of the user's font and you use that in computations. This is
usually more user-friendly.

> Now the question is, is there a way to ask windows to increase leading
> space in MS UI Gothic without having to programmatically do it for every
> page.

I'm not an expert, but here is my guess: I think you would have to design
your own font in order to do that. Or here's a more complicated guess: If
Windows has a way for you to tell it programmatically to adjust spacing
without adjusting character shapes and sizes, then you use it; but if
Windows doesn't have a way, then you invent a way and patent it ^_^

neel...@rediffmail.com

unread,
Jul 18, 2007, 8:23:22 AM7/18/07
to

Norman Diamond wrote:
> <neel...@rediffmail.com> wrote in message
> news:1182160366....@x35g2000prf.googlegroups.com...
> > On Jun 18, 1:57 pm, "Norman Diamond" <ndiam...@community.nospam> wrote:

> > Now the question is, is there a way to ask windows to increase leading
> > space in MS UI Gothic without having to programmatically do it for every
> > page.
>

Norman,

Thanks for the reply. Here is the _underhanded_ check MFC (not
windows) does ONLY FOR PROPERTY SHEET AND ONLY FOR JAPANESE:

// file: Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src
\mfc\ccdata.cpp

BOOL AFXAPI AfxGetPropSheetFont(CString& strFace, WORD& wSize, BOOL
bWizard)
{
// <snip>
if (pfnGetUserDefaultUILanguage != NULL)
{
LANGID langid;
langid = pfnGetUserDefaultUILanguage();
if ((PRIMARYLANGID(langid) == LANG_JAPANESE) &&
IsFontInstalled(_T("MS UI Gothic")))
wLang = MAKELANGID(LANG_JAPANESE, 0x3f);
}
if (wLang != 0)
{
hResource = ::FindResourceEx(hInst, RT_DIALOG,
MAKEINTRESOURCE(bWizard ? IDD_WIZARD : IDD_PROPSHEET), wLang);
}
// <snip>
}

>From this point on, I believe, there is NO WAY anyone can specify any
other font other than explicitly setting different font for individual
controls/dialogs. Do note that for a dialog (derived from CDialog and
not CPropertySheet/CPropertyPage), happily takes "MS Shell Dlg 2" as
font without doing ANYTHING extra :)

I wonder whose bright idea it was and why (since there are NO comments
in code why they fell in love with MS UI Gothic)?

Thanks,
Neel.

Michael S. Kaplan [MSFT]

unread,
Jul 25, 2007, 10:53:51 AM7/25/07
to
Sigh.

THIS IS INTENTIONAL. There has been specific feedback from the market that
the model of "use the Latin based font, fall back to the one with the
Kana/Kanji" was not as well liked.

If you do not agree, DON'T USE MS Shell Dlg or MS Shell Dlg 2. Using them is
asking Microsoft to "do what you have been told is the best thing to do in
the market."


--
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with


no warranties, and confers no rights.

<neel...@rediffmail.com> wrote in message
news:1184761402....@j4g2000prf.googlegroups.com...

neel...@rediffmail.com

unread,
Jul 26, 2007, 7:56:32 AM7/26/07
to
Michael S. Kaplan [MSFT] wrote:

> If you do not agree, DON'T USE MS Shell Dlg or MS Shell Dlg 2. Using them is
> asking Microsoft to "do what you have been told is the best thing to do in
> the market."
>

There are only two things really:
1) Dialogs don't do this, only property sheets do, which is strange
because I don't understand why UI feedback would only be applied for
property sheet and not dialogs.
2) Even if I specify "Tahoma" _explicitly_ in resource file for
property page with minium options (DS_3DLOOK | WS_POPUP | WS_CAPTION |
WS_SYSMENU), even then, property page will have MS UI Gothic because
of hardcoding. That means only other way is to create font and set it
by using CWnd::SetFont() ?

Thanks,
Neel.

Michael S. Kaplan [MSFT]

unread,
Jul 27, 2007, 3:19:32 AM7/27/07
to
Well, the different code is there because it is preferred in the market.

Are you working off of specific feedback to the contrary?


--
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.


<neel...@rediffmail.com> wrote in message
news:1185450992.6...@d30g2000prg.googlegroups.com...

neel...@rediffmail.com

unread,
Aug 23, 2007, 2:48:32 AM8/23/07
to
On Jul 27, 12:19 pm, "Michael S. Kaplan [MSFT]"

<mic...@online.microsoft.com> wrote:
> Well, the different code is there because it is preferred in the market.
>
> Are you working off of specific feedback to the contrary?
>

Sorry for replying late. Yes, as I have mentioned in my post in this
thread, June 18 2:52 pm, feedback that I got is that horizontal and
vertical leading space in "MS UI Gothic" is too low so that characters
almost touch other from each side in case of Japanese text. That's the
reason why I was trying to find out a way to change font without
having to set the font explicitly for _every_ dialog/control.

Thanks,
Neel.

Michael S. Kaplan [MSFT]

unread,
Aug 23, 2007, 7:43:13 AM8/23/07
to
No, there is not. If you use MS Shell Dlg or MS Shell Dlg 2, then you are
asking someone else to decide; if you would rather decide, then you have to
step up and actually make the decision....


--
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.


<neel...@rediffmail.com> wrote in message
news:1187851712.7...@e9g2000prf.googlegroups.com...

neel...@rediffmail.com

unread,
Aug 23, 2007, 11:05:43 PM8/23/07
to
On Aug 23, 4:43 pm, "Michael S. Kaplan [MSFT]"

<mic...@online.microsoft.com> wrote:
> No, there is not. If you use MS Shell Dlg or MS Shell Dlg 2, then you are
> asking someone else to decide; if you would rather decide, then you have to
> step up and actually make the decision....

Thanks, but, from the code is quite clear that once MS UI Gothic is
installed, there isn't any other way. As far as I know if I give
different font explicitly in resource script (Tahoma for example) with
minimum required set of flags (DS_3DLOOK | WS_POPUP | WS_CAPTION |
WS_SYSMENU for example) I should be able to get different font for
property page since I am explicitly asking for different font and its
neither MS Shell Dlg nor MS Shell Dlg 2. Using SetFont or handling
WM_SETFONT message is usually not a problem but that's when you have
couple of dialogs/pages to take care of. If you have to change 20
pages it becomes a huge task. I am sure there is a very quick way to
do it (and I can think of couple of them myself so it's not high
tech), but, it's unnecessary work when specifying different font in
the resource script explicitly suffice instead.

Thanks,
Neel.

Michael S. Kaplan [MSFT]

unread,
Aug 24, 2007, 2:02:45 AM8/24/07
to
???????

Huh?

The title of this thread and the bulk of the messages have talked about
wanting to use MS Shell Dlg or MS Shell Dlg 2 and being unhappy with the
results of that choice on Japanese systems.

I am and have been responding to that point.

Are you thinking of something else?


--
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.

<neel...@rediffmail.com> wrote in message
news:1187924743....@i13g2000prf.googlegroups.com...

neel...@rediffmail.com

unread,
Aug 24, 2007, 4:25:44 AM8/24/07
to
On Aug 24, 11:02 am, "Michael S. Kaplan [MSFT]"

<mic...@online.microsoft.com> wrote:
> Are you thinking of something else?

Yes, I was thinking that the ability (in MFC) to specify different
font in resource script explicitly *at least* should be there and that
is all that should be required (not C++ code change) since it's not
possible to specify MS Shell* font. I agree that the thread started
with Shell* font but note that my intention always was to change the
font through resource files; MS Shell Dlg 2 was just what the
documentation mentioned (point 3.c in the original post).

Thanks,
Neel.

0 new messages