Je ne sais si ce programme doit être posté ici, sinon déplacer le à votre gré.
Voici le même prg avec une meilleure présentation.
1) une animation de window ( on peut s’amuser).
Code : Tout sélectionner
Enumeration
#Window_Main
#Gadget_Button
#Gadget_String
#Gadget_ListIcon
#Gadget_Image
#Image
EndEnumeration
#AW_HOR_POSITIVE = $1 ; Anime window de la gauche vers la droite. ces indicateurs peuvent être utilisés en rouleau ou en animation de diapositives
#AW_HOR_NEGATIVE = $2 ; Anime window de la droite vers la gauche.
#AW_VER_POSITIVE = $4 ; Anime window du haut vers le bas.
#AW_VER_NEGATIVE = $8 ; Anime window du bas vers le haut.
#AW_CENTER = $10 ; anime window en partant du centre
#AW_HIDE = $10000 ; Cache window.//par défaut window est activé
#AW_ACTIVATE = $20000 ; Active window.
#AW_SLIDE = $40000 ; Utilise l'animation de la diapositive. Par défaut, l'animation en rouleau est utilisé.
#AW_BLEND = $80000 ; Utilise un effet de fondu. Cet indicateur peut être utilisé que si hwnd est une fenêtre de niveau supérieur.
Procedure EnumFontFamProc(lpelf.l, lpntm.l, FontType.l, lParam.l)
Static FontCounter.l
*lpelf.ENUMLOGFONT = lpelf
sFontType.s = ""
TrueType = #False
If FontType & #DEVICE_FONTTYPE
sFontType.s + "Device "
EndIf
If FontType & #RASTER_FONTTYPE
sFontType.s + "Raster "
EndIf
If FontType & #TRUETYPE_FONTTYPE
sFontType.s + "TrueType "
TrueType = #True
EndIf
FontHeight = *lpelf\elfLogFont\lfHeight
FontWidth = *lpelf\elfLogFont\lfWidth
FontEscapement = *lpelf\elfLogFont\lfEscapement
FontOrientation = *lpelf\elfLogFont\lfOrientation
FontWeight = *lpelf\elfLogFont\lfWeight
FontItalic = *lpelf\elfLogFont\lfItalic
FontUnderline = *lpelf\elfLogFont\lfUnderline
FontStrikeOut = *lpelf\elfLogFont\lfStrikeOut
FontCharSet = *lpelf\elfLogFont\lfCharSet
FontOutPrecision = *lpelf\elfLogFont\lfOutPrecision
FontClipPrecision = *lpelf\elfLogFont\lfClipPrecision
FontQuality = *lpelf\elfLogFont\lfQuality
FontPitchAndFamily = *lpelf\elfLogFont\lfPitchAndFamily
FontName.s=PeekS(@*lpelf\elfFullName[0])
FontStyle.s=PeekS(@*lpelf\elfStyle[0])
If TrueType
*lpntm1.NEWTEXTMETRIC = lpntm
MetricHeight = *lpntm1\tmHeight
MetricAscent = *lpntm1\tmAscent
MetricDescent = *lpntm1\tmDescent
MetricInternalLeading = *lpntm1\tmInternalLeading
MetricExternalLeading = *lpntm1\tmExternalLeading
MetricAveCharWidth = *lpntm1\tmAveCharWidth
MetricMaxCharWidth = *lpntm1\tmMaxCharWidth
MetricWeight = *lpntm1\tmWeight
MetricOverhang = *lpntm1\tmOverhang
MetricDigitizedAspectX = *lpntm1\tmDigitizedAspectX
MetricDigitizedAspectY = *lpntm1\tmDigitizedAspectY
MetricFirstChar = *lpntm1\tmFirstChar
MetricLastChar = *lpntm1\tmLastChar
MetricDefaultChar = *lpntm1\tmDefaultChar
MetricBreakChar = *lpntm1\tmBreakChar
MetricItalic = *lpntm1\tmItalic
MetricUnderlined = *lpntm1\tmUnderlined
MetricStruckOut = *lpntm1\tmStruckOut
MetricPitchAndFamily = *lpntm1\tmPitchAndFamily
MetricCharSet = *lpntm1\tmCharSet
MetricFlags = *lpntm1\ntmFlags
MetricSizeEM = *lpntm1\ntmSizeEM
MetricCellHeight = *lpntm1\ntmCellHeight
MetricAveWidth = *lpntm1\ntmAvgWidth
Else
*lpntm2.TEXTMETRIC = lpntm
MetricHeight = *lpntm2\tmHeight
MetricAscent = *lpntm2\tmAscent
MetricDescent = *lpntm2\tmDescent
MetricInternalLeading = *lpntm2\tmInternalLeading
MetricExternalLeading = *lpntm2\tmExternalLeading
MetricAveCharWidth = *lpntm2\tmAveCharWidth
MetricMaxCharWidth = *lpntm2\tmMaxCharWidth
MetricWeight = *lpntm2\tmWeight
MetricOverhang = *lpntm2\tmOverhang
MetricDigitizedAspectX = *lpntm2\tmDigitizedAspectX
MetricDigitizedAspectY = *lpntm2\tmDigitizedAspectY
MetricFirstChar = *lpntm2\tmFirstChar
MetricLastChar = *lpntm2\tmLastChar
MetricDefaultChar = *lpntm2\tmDefaultChar
MetricBreakChar = *lpntm2\tmBreakChar
MetricItalic = *lpntm2\tmItalic
MetricUnderlined = *lpntm2\tmUnderlined
MetricStruckOut = *lpntm2\tmStruckOut
MetricPitchAndFamily = *lpntm2\tmPitchAndFamily
MetricCharSet = *lpntm2\tmCharSet
EndIf
sFontAttributes.s = ""
If FontItalic
sFontAttributes + "I"
EndIf
If FontUnderline
sFontAttributes + "U"
EndIf
If FontStrikeOut
sFontAttributes + "S"
EndIf
If sFontAttributes <> ""
sFontAttributes = "(" + sFontAttributes + ")"
EndIf
If lParam
If FindString(LCase(FontName), LCase(PeekS(lParam)), 1)
AddGadgetItem(#Gadget_ListIcon, -1, FontName + Chr(10) + Str(FontWidth) + Chr(10) + Str(FontHeight) + Chr(10) + Str(FontWeight) + Chr(10) + FontStyle + " " + sFontAttributes + Chr(10) + sFontType)
EndIf
Else
AddGadgetItem(#Gadget_ListIcon, -1, FontName + Chr(10) + Str(FontWidth) + Chr(10) + Str(FontHeight) + Chr(10) + Str(FontWeight) + Chr(10) + FontStyle + " " + sFontAttributes + Chr(10) + sFontType)
EndIf
While WindowEvent()
Wend
FontCounter + 1
ProcedureReturn 1
EndProcedure
WindowWidth = 640
WindowHeight = 480
WindowTitle.s = "Polices installées sur Window. Cliquez sur une police pour la voir"
ImageWidth = WindowWidth - 20
ImageHeight = 120
If OpenWindow(#Window_Main, 0, 0, WindowWidth, WindowHeight, WindowTitle, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered | #PB_Window_Invisible)
; AnimateWindow_(WindowID(#Window_Main), 1500, #AW_BLEND | #AW_ACTIVATE)
; AnimateWindow_(WindowID(#Window_Main), 1500, #AW_CENTER | #AW_ACTIVATE)
AnimateWindow_(WindowID(#Window_Main), 1500, #AW_VER_POSITIVE|#AW_HOR_POSITIVE | #AW_ACTIVATE)
AddKeyboardShortcut(#Window_Main, #PB_Shortcut_Escape, #PB_Shortcut_Escape)
AddKeyboardShortcut(#Window_Main, #PB_Shortcut_Return, #Gadget_Button)
ListIconGadget(#Gadget_ListIcon, 10, 40, WindowWidth - 20, WindowHeight - 180, "Name", 240)
AddGadgetColumn(#Gadget_ListIcon, 1, "Largeur", 50)
AddGadgetColumn(#Gadget_ListIcon, 2, "Hauteur", 50)
AddGadgetColumn(#Gadget_ListIcon, 3, "Poids", 50)
AddGadgetColumn(#Gadget_ListIcon, 4, "Style & Attr.", 80)
AddGadgetColumn(#Gadget_ListIcon, 5, "Type", 70)
EnumFontFamilies_(GetDC_(WindowID(#Window_Main)), #Null, @EnumFontFamProc(), 0)
Quit = #False
Repeat
WindowEvent = WindowEvent()
EventType = EventType()
Select WindowEvent
Case #PB_Event_CloseWindow
Quit = #True
Case #PB_Event_Menu
Select EventMenu()
Case #PB_Shortcut_Escape
Quit = #True
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case #Gadget_ListIcon
FontName.s = GetGadgetItemText(#Gadget_ListIcon, GetGadgetState(#Gadget_ListIcon), 0)
FontSize.l = Val(GetGadgetItemText(#Gadget_ListIcon, GetGadgetState(#Gadget_ListIcon), 1))
; FontHeight.l = Val(GetGadgetItemText(#Gadget_ListIcon, GetGadgetState(#Gadget_ListIcon), 2))
FontID1 =LoadFont(#PB_Any, FontName, 20, #PB_Font_HighQuality)
SetGadgetFont(#PB_Default, FontID( FontID1))
TextGadget(#Window_Main, 20, WindowHeight - 130, WindowWidth-20, 45, FONTName)
TextGadget(#Window_Main+1, 20, WindowHeight - 130+50, WindowWidth-20, 45,"1233 abcd ABCD àçéèêù")
EndSelect
Case #PB_Event_SizeWindow
; Debug _nl+_n(#PB_Event_SizeWindow)
EndSelect
Until Quit
AnimateWindow_(WindowID(#Window_Main), 1000, #AW_BLEND | #AW_HIDE)
EndIf
End