No announcement yet.

Dialogs and Charset

  • Filter
  • Time
  • Show
Clear All
new posts

  • Dialogs and Charset

    Hi, guys --
    Strange situation. Win2000.
    In DLGTEMPLATEEX charset (for test) is %greek_charset.
    But controls have %russian_charset (default settings).

    I try to set directly through %WM_SETFONT - no effect (I mean charset only; width/height/facename - all works).
    I am sure that in hFont for WM_SETFONT has %greek_charset (I copied a fragment from SDK app, where it works fine).

    What I'm doing wrong ?

    E-MAIL: [email protected]

  • #2
    After some tests (incl. SDK-style) I understood that a problem not in dialog as it is.
    It looks that exactly BUTTON and STATIC, unlike EDIT do not understand charset.
    Any ideas ?

       #Compile Exe
       #Dim All
       #Register None
       #Include "WIN32API.INC"
       $Text = "Ñåìåí"
       CallBack Function DlgProc
         Select Case CbMsg
            Case %WM_INITDIALOG
               Dim i As Long, lf As Logfont, hFont As Static Long
               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
               i = GetStockObject(%DEFAULT_GUI_FONT)
               GetObject i, SizeOf(lf), ByVal VarPtr(lf)
               lf.lfCharset = %TURKISH_CHARSET
               hFont = CreateFontIndirect(lf)
               For i = 1 To 3
                  PostMessage GetDlgItem(CbHndl, 100 + i), %WM_SETFONT, hFont, 1
            Case %WM_DESTROY
               DeleteObject hFont
         End Select
       End Function
       Function PbMain
          Dim hDlg As Long
          Dialog New %HWND_DESKTOP, "", , , 200, 200 To hDlg
          Dialog Show Modal hDlg Call DlgProc
        End Function

    E-MAIL: [email protected]