I have a program written in C and Win32 (not UNICODE).
Recently i added to it a manifest file for getting XP look.
There is a dialog with an edit control that has to display text with cyrillic font and since i'm using Windows in Italian i changhe the control font with WM_SETFONT.
This is the code:
WindowHandle --- is the dialog window handle: the dialog is created with DialogBox(...) function.
LOGFONT MyLogicalFont;
HDC DeviceContext;
HFONT MyFontHandle;
.....
case WM_INITDIALOG:
DeviceContext=GetDC(GetDlgItem(WindowHandle,MY_EDIT_ID));
MyLogicalFont.lfHeight=-MulDiv(8,GetDeviceCaps(DeviceContext,LOGPIXELSY),72);
ReleaseDC(GetDlgItem(WindowHandle,MY_EDIT_ID),DeviceContext);
MyLogicalFont.lfWidth=0;
MyLogicalFont.lfEscapement=0;
MyLogicalFont.lfOrientation=0;
MyLogicalFont.lfWeight=FW_THIN;
MyLogicalFont.lfItalic=0;
MyLogicalFont.lfUnderline=0;
MyLogicalFont.lfStrikeOut=0;
MyLogicalFont.lfCharSet=RUSSIAN_CHARSET;
MyLogicalFont.lfOutPrecision=OUT_DEFAULT_PRECIS;
MyLogicalFont.lfClipPrecision=CLIP_DEFAULT_PRECIS;
MyLogicalFont.lfQuality=PROOF_QUALITY;
MyLogicalFont.lfPitchAndFamily=DEFAULT_PITCH | FF_DONTCARE;
strcpy(MyLogicalFont.lfFaceName,"Arial CYR");
MyFontHandle=CreateFontIndirect(&MyLogicalFont);
SendMessage(EditWindow,WM_SETFONT,(WPARAM)MyFontHandle,FALSE);
SetDlgItemText(WindowHandle,MY_EDIT_ID,"Ïèòàíèå ðàñøèðåíèÿ");
.....
break;
For viewing cyrillic text i have "International support" installed on 98 and the Russian keyboard installed on 2000 and XP
(so the multicharset version of the Arial font is installed).
Without the manifest file the program works well on all platforms (98,2000,XP) but with the manifest file
it doesn't work in XP: in the edit control i have accented character (since my system code page is for Italian)
insted of cyrillic characters. It seems that the edit control ignores the charset or the font name at all.
I tried to set XP to Classic mode (like 2000) but the problem persists.
I tried to reset the theme for the edit control via SetWindowTheme(GetDlgItem(WindowHandle,MY_EDIT_ID),L"",L"") but the problem persists.
I think that the problem is related to version 6 of common controls DLL: is it possible to continue using the manifest
file for the application but set for a specific dialog or control (the edit control in my case) the use of version 5
of the common controls DLL?
Thanks in advance.
Recently i added to it a manifest file for getting XP look.
There is a dialog with an edit control that has to display text with cyrillic font and since i'm using Windows in Italian i changhe the control font with WM_SETFONT.
This is the code:
WindowHandle --- is the dialog window handle: the dialog is created with DialogBox(...) function.
LOGFONT MyLogicalFont;
HDC DeviceContext;
HFONT MyFontHandle;
.....
case WM_INITDIALOG:
DeviceContext=GetDC(GetDlgItem(WindowHandle,MY_EDIT_ID));
MyLogicalFont.lfHeight=-MulDiv(8,GetDeviceCaps(DeviceContext,LOGPIXELSY),72);
ReleaseDC(GetDlgItem(WindowHandle,MY_EDIT_ID),DeviceContext);
MyLogicalFont.lfWidth=0;
MyLogicalFont.lfEscapement=0;
MyLogicalFont.lfOrientation=0;
MyLogicalFont.lfWeight=FW_THIN;
MyLogicalFont.lfItalic=0;
MyLogicalFont.lfUnderline=0;
MyLogicalFont.lfStrikeOut=0;
MyLogicalFont.lfCharSet=RUSSIAN_CHARSET;
MyLogicalFont.lfOutPrecision=OUT_DEFAULT_PRECIS;
MyLogicalFont.lfClipPrecision=CLIP_DEFAULT_PRECIS;
MyLogicalFont.lfQuality=PROOF_QUALITY;
MyLogicalFont.lfPitchAndFamily=DEFAULT_PITCH | FF_DONTCARE;
strcpy(MyLogicalFont.lfFaceName,"Arial CYR");
MyFontHandle=CreateFontIndirect(&MyLogicalFont);
SendMessage(EditWindow,WM_SETFONT,(WPARAM)MyFontHandle,FALSE);
SetDlgItemText(WindowHandle,MY_EDIT_ID,"Ïèòàíèå ðàñøèðåíèÿ");
.....
break;
For viewing cyrillic text i have "International support" installed on 98 and the Russian keyboard installed on 2000 and XP
(so the multicharset version of the Arial font is installed).
Without the manifest file the program works well on all platforms (98,2000,XP) but with the manifest file
it doesn't work in XP: in the edit control i have accented character (since my system code page is for Italian)
insted of cyrillic characters. It seems that the edit control ignores the charset or the font name at all.
I tried to set XP to Classic mode (like 2000) but the problem persists.
I tried to reset the theme for the edit control via SetWindowTheme(GetDlgItem(WindowHandle,MY_EDIT_ID),L"",L"") but the problem persists.
I think that the problem is related to version 6 of common controls DLL: is it possible to continue using the manifest
file for the application but set for a specific dialog or control (the edit control in my case) the use of version 5
of the common controls DLL?
Thanks in advance.