Talboum
Messages postés16Date d'inscriptionmardi 31 octobre 2000StatutMembreDernière intervention18 novembre 2009
-
3 mai 2009 à 00:00
PCPT
Messages postés13280Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 2018
-
3 mai 2009 à 10:58
Bonjour,
Je débute en VB.
J'aimerais récupérer les polices de caractères installées dans mon word (dans mon windows en fait) pour les mettre dans une liste.
Une petite piste pour m'aider ? Un tout grand merci.
lfHeight As Long
lfWidth As Long
lfEscapement As Long
lfOrientation As Long
lfWeight As Long
lfItalic As Byte
lfUnderline As Byte
lfStrikeOut As Byte
lfCharSet As Byte
lfOutPrecision As Byte
lfClipPrecision As Byte
lfQuality As Byte
lfPitchAndFamily As Byte
lfFaceName(LF_FACESIZE) As Byte
End Type
'
Public Declare Function EnumFonts Lib "gdi32" Alias "EnumFontsA" (ByVal hdc As Long, ByVal lpsz As String, ByVal lpFontEnumProc As Long, ByVal lParam As Long) As
Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
'
Public Function EnumFontProc(ByVal lplf As Long, ByVal lptm
As Long, ByVal dwType As Long, ByVal lpData As Long) As
Long
Dim LF As LOGFONT
Dim ZeroPos As Long
Dim FontName As String
Call CopyMemory(LF, ByVal lplf, LenB(LF))
FontName = StrConv(LF.lfFaceName, vbUnicode)
ZeroPos = InStr(1, FontName, Chr$(0))
If ZeroPos > 0 Then Debug.Print Left$(FontName, ZeroPos - 1)
EnumFontProc = True
End Function
' EXEMPLE
D'UTILISATION
Private Sub Form_Load()
Call EnumFonts(Me.hdc, vbNullString, AddressOf EnumFontProc, 0&)
End Sub
il suffit de remplacer
Debug.Print
par
taform.talist.additem
<hr size="2" width="100%" />
Prenez un instant pour répondre à [sujet-SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp