R
Randy_Mic
Unregistered / Unconfirmed
GUEST, unregistred user!
在TFontDialog执行的时候可以看到,字体"System"的Style有"粗体,粗斜体"两种,但我自己用EnumFontFamiliesEx取出的Style怎么是空啊?<br>Up有分~~~~~~<br><br>代码如下:<br>function EnumFontFamExProc(lpelfe: PEnumLogFontEx;<br> lpntme: PNewTextMetricEx; FontType: DWORD; lParam: LPARAM): Integer;stdcall;<br>begin<br>{ tagENUMLOGFONTEXA = packed record<br> elfLogFont: TLogFontA;<br> elfFullName: array[0..LF_FULLFACESIZE - 1] of AnsiChar;<br> elfStyle: array[0..LF_FACESIZE - 1] of AnsiChar;<br> elfScript: array[0..LF_FACESIZE - 1] of AnsiChar;<br> end;<br>}<br> if lParam = 0 then<br> Form1.ListBox1.Items.Add(lpelfe.elfFullName)<br> else<br> Form1.ListBox2.Items.Add(lpelfe.elfStyle);<br> Result := 1;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> DC: HDC;<br>begin<br> LF.lfCharSet := DEFAULT_CHARSET;<br> LF.lfFaceName := '';<br> LF.lfPitchAndFamily := 0;<br> DC := GetDC(Handle);<br> EnumFontFamiliesEx(DC, LF, @EnumFontFamExProc, 0, 0);<br> ReleaseDC(Handle, DC);<br>end;