PlanetSquires Forums

Support Forums => José Roca Software => Topic started by: docroger on February 09, 2026, 06:20:00 AM

Title: Windows Font Selector
Post by: docroger on February 09, 2026, 06:20:00 AM
Hello José,

How can i have the font selector (aka display font in powerbasic)?
Dont find any example with afxnova.

Thanx for any help.
Title: Re: Windows Font Selector
Post by: José Roca on February 09, 2026, 06:43:25 AM
It doesn't need a wrapper. Fill a CHOOSEFONTW structure and call the ChooseFontW function.

type tagCHOOSEFONTW
lStructSize as DWORD
hwndOwner as HWND
hDC as HDC
lpLogFont as LPLOGFONTW
iPointSize as INT_
Flags as DWORD
rgbColors as COLORREF
lCustData as LPARAM
lpfnHook as LPCFHOOKPROC
lpTemplateName as LPCWSTR
hInstance as HINSTANCE
lpszStyle as LPWSTR
nFontType as WORD
___MISSING_ALIGNMENT__ as WORD
nSizeMin as INT_
nSizeMax as INT_
end type
#else
type tagCHOOSEFONTW field = 1
lStructSize as DWORD
hwndOwner as HWND
hDC as HDC
lpLogFont as LPLOGFONTW
iPointSize as INT_
Flags as DWORD
rgbColors as COLORREF
lCustData as LPARAM
lpfnHook as LPCFHOOKPROC
lpTemplateName as LPCWSTR
hInstance as HINSTANCE
lpszStyle as LPWSTR
nFontType as WORD
___MISSING_ALIGNMENT__ as WORD
nSizeMin as INT_
nSizeMax as INT_
end type
#endif

type CHOOSEFONTW as tagCHOOSEFONTW
type LPCHOOSEFONTW as tagCHOOSEFONTW ptr

declare function ChooseFontW(byval as LPCHOOSEFONTW) as WINBOOL
Title: Re: Windows Font Selector
Post by: José Roca on February 09, 2026, 06:51:28 AM
CHOOSEFONTW structure

See Microsoft documentation:
https://learn.microsoft.com/en-us/windows/win32/api/commdlg/ns-commdlg-choosefontw