I know i'm missing something but i sure can't find it. I even opened the "commdlg32.dll" library and called ChooseFont with no luck.????
Code: Select all
Structure LOGFONT2
lfHeight.l
lfWidth.l
lfEscapement.l
lfOrientation.l
lfWeight.l
lfItalic.b
lfUnderline.b
lfStrikeOut.b
lfCharSet.b
lfOutPrecision.b
lfClipPrecision.b
lfQuality.b
lfPitchAndFamily.b
lfFaceName.b[50]
EndStructure
Structure CHOOSEFONT
lStructSize.l
hwndOwner.l
hDC.l
lpLogFont.l
iPointSize.l
Flags.l
rgbColors.l
lCustData.l
lpfnHook.l
lpTemplateName.b
hInstance.l
lpszStyle.l
nFontType.w
missing_alignment.w
nSizeMin.l
nSizeMax.l
EndStructure
Declare Font()
Quit.l = 0
#TRUE = 1
If OpenWindow(0, 0, 0, 300, 200, #PB_Window_SystemMenu, "All Fonts")
Repeat
EventID.l = WaitWindowEvent()
If EventID = #PB_EventCloseWindow
Quit = 1
ElseIf EventID = #PB_EVENTREPAINT
Font()
EndIf
Until Quit = 1
EndIf
End
Procedure Font()
lf.LOGFONT2
lf\lfHeight=-24
lf\lfWeight=700
lf\lfWidth=0
lf\lfStrikeOut=1
PokeS(@lf\lfFaceName[0], "cuckoo")
cf.CHOOSEFONT
cf\lStructSize=SizeOf(CHOOSEFONT)
cf\hwndOwner=WindowID()
cf\hDC=#NULL
cf\lpLogFont=@lf
cf\iPointSize=0
cf\rgbColors=0
cf\lCustData=0
cf\lpfnHook=0
cf\lpTemplateName=0
cf\hInstance=0
cf\lpszStyle=0
cf\nSizeMax=0
cf\nSizeMin=0
cf\nFontType=0
cf\Flags=#CF_INITTOLOGFONTSTRUCT | #CF_SCREENFONTS | #CF_EFFECTS
ChooseFont_(@cf) ; Does nothing....
*DC = GetDC_(WindowID())
SetBkMode_(*DC, #TRANSPARENT)
fontHdl=CreateFontIndirect_(@lf.LOGFONT2)
SelectObject_(*DC,fontHdl)
SetTextColor_(*DC,$00000ff)
TextOut_(*DC,10,10,"My Font",7)
DeleteObject_(fontHdl)
ReleaseDC_(WindowID(), *DC)
EndProcedure