記憶のどっかに留めておこう。
Private Declare Function GetTextFace Lib "gdi32" Alias "GetTextFaceA" (ByVal hdc As Long, ByVal nCount As Long, ByVal lpFacename As String) As Long
'----------------------------------------------------------------------- ' 関数名 : GetDCFontName ' 機能 : デバイスコンテキストのフォント名を取得する ' 引数 : (in) hDC … デバイスコンテキストのハンドル ' 戻り値 : デバイスコンテキストのフォント名 '----------------------------------------------------------------------- Public Function GetDCFontName(ByVal hDC As Long) As String Dim FontName As String * 256 Call GetTextFace(hDC, Len(FontName), FontName) GetDCFontName = Left$(FontName, InStr(FontName, Chr$(0)) - 1) End Function |