Under Win2000 with the same hFont I see different results:
textbox - as expected, label and button - the same font but with default charset.
Why ? And how it could be ? What is hFont ?
[This message has been edited by Semen Matusovski (edited March 02, 2001).]
textbox - as expected, label and button - the same font but with default charset.
Why ? And how it could be ? What is hFont ?
Code:
#Compile Exe #Dim All #Register None #Include "WIN32API.INC" CallBack Function DlgProc Select Case CbMsg Case %WM_INITDIALOG Dim i As Long, lf As Logfont, hFont1 As Static Long, hFont2 As Static Long Dim Text As String Text = Chr$(209, 229, 236, 229, 237) Control Add Button, CbHndl, 101, Text, 10, 10, 100, 15 Control Add TextBox, CbHndl, 102, Text, 10, 30, 100, 15 Control Add Label, CbHndl, 103, Text, 10, 50, 100, 15 Control Add Button, CbHndl, 104, Text, 10, 80, 100, 15 Control Add TextBox, CbHndl, 105, Text, 10, 110, 100, 15 Control Add Label, CbHndl, 106, Text, 10, 140, 100, 15 i = GetStockObject(%DEFAULT_GUI_FONT) GetObject i, SizeOf(lf), ByVal VarPtr(lf) lf.lfCharset = %TURKISH_CHARSET lf.lfWeight = %FW_BOLD hFont1 = CreateFontIndirect(lf) For i = 1 To 3 PostMessage GetDlgItem(CbHndl, 100 + i), %WM_SETFONT, hFont1, 1 Next lf.lfCharset = %RUSSIAN_CHARSET hFont2 = CreateFontIndirect(lf) For i = 4 To 6 PostMessage GetDlgItem(CbHndl, 100 + i), %WM_SETFONT, hFont2, 1 Next Case %WM_DESTROY DeleteObject hFont1 DeleteObject hFont2 End Select End Function Function PbMain Dim hDlg As Long Dialog New %HWND_DESKTOP, "", , , 200, 200, %WS_SYSMENU To hDlg Dialog Show Modal hDlg Call DlgProc End Function
Comment