Main Menu

Recent posts

#1
José Roca Software / Re: Windows Font Selector
Last post by José Roca - February 09, 2026, 06:51:28 AM
#2
José Roca Software / Re: Windows Font Selector
Last post by José Roca - 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
#3
José Roca Software / Windows Font Selector
Last post by docroger - 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.
#4
José Roca Software / Re: Searching a File
Last post by Frank Bruebach - February 07, 2026, 02:33:26 PM
yes I know. its all ok here. my folder AfxNova2 contains all your updated files.
subfolder below name is Afxnova havent changed that. I have installed tiko 1.2.6 again and all is working like I wished.

I am trying to build a new Editor with afxnova files.  You Made a very great Job Jose There are more than 2000 files you have built.. its a pity only few people have recognized this Special winapi wrapper Format (SDK)   for freebasic.. I came from Powerbasic Site too and  it was Not so easy at the beginning to understand freebasic language with all new constructor type declaration Handling ...

thanks, frank
#5
José Roca Software / Re: Searching a File
Last post by José Roca - February 07, 2026, 11:22:01 AM
You must copy them in the AfxNova folder, not a folder with a different name, because they use #include once AfxNova/... If you use a different folder name, the file is not found.
#6
José Roca Software / Re: Searching a File
Last post by Frank Bruebach - February 07, 2026, 04:38:58 AM
hello paul thanks for your feedback.  yes I know this file but had problem to install
new AfxNova files (copy paste) in a new folder AfxNova2 I have named it. then the "AfxNova/AfxStr.inc" file was missing with Error Message by compiling dont know why.
I copied this file seperately to my templates example folder
#include once "AfxStr.inc" and my example works ok.
I am using tiko 1.2.6. perhaps its a problem by downloading from jose's github repository with AfxNova files.
I noticed this strange behaviour last days.

wish to have a nice weekend 

#7
José Roca Software / Re: Searching a File
Last post by Paul Squires - February 06, 2026, 05:27:54 PM
#8
José Roca Software / Searching a File
Last post by Frank Bruebach - February 06, 2026, 04:35:28 PM

hello jose, where and in which of afxnova include files I can found

a) AfxStrParseCount() ?
b) AfxStrParse() ?

code snippet
DIM cws AS dwstring
               IF LEN(cws) THEN
                     DIM nItems AS LONG = AfxStrParseCount(cws)
                     IF nItems THEN
                        DIM cwsPath AS DWSTRING = AfxStrParse(cws, 1)
                        MessageBoxW(hwnd, cwsPath, "Path", MB_OK)
                        FOR i AS LONG = 2 TO nItems
                           MessageBoxW(hwnd, AfxStrParse(cws, i), "File", MB_OK)
                        NEXT
                     END IF
                  END IF

thanks, frank
               
#9
PlanetSquires Software / Re: Tiko 1.3 horizontal scroll...
Last post by Paul Squires - January 25, 2026, 03:13:42 PM
Thanks, I will investigate.   :)
#10
José Roca Software / Re: AfxNova progress
Last post by José Roca - January 25, 2026, 02:29:56 PM
Static classes

A practical design choice rooted in how Win32 actually works.

Windows standard controls — BUTTON, EDIT, LISTBOX, etc. — are not object‑oriented. They are handle‑based, message‑driven window classes created by the OS.

This means:

- Windows owns the control
- You interact with it through an HWND
- All operations happen through messages and APIs
- The control can be accessed from anywhere as long as you have the handle
- Trying to wrap this model in strict OOP creates more problems than it solves.

AfxNova's static classes embrace the Win32 model instead of fighting it.

Classic OOP pain points:

- Where do I store the object?
- How do I access the control from a callback?
- How do I map HWND → object?
- What happens when the control is destroyed?"

A static class in AfxNova:

- does not need an instance
- does not track lifetime
- does not require storing objects
- works directly with the HWND
- can be called from anywhere
- matches the Win32 philosophy exactly

Example:

CButton.SetIcon(hButton, hIcon)
CButton.Enable(hButton)
CButton.SetText(hButton, "OK")

This is clean, predictable, and 100% compatible with how Windows expects you to work.

Why static classes are beneficial

Static classes let you group all related functionality in one place, instead of scattering macros and procedures across multiple files. They also allow the use of overloaded methods, making the API easier and more intuitive to use.

As a proof-of-concept, I have impremented CButton, a static class that wraps the functionality of a Button control. It is available at https://github.com/JoseRoca/AfxNova/blob/main/AfxNova/CButton.inc

This shows how a static class can group all related functionality in one place, provide overloads for ease of use, and remain fully compatible with the native Win32 handle‑based model.

These classes aren't limited to Windows controls — the same approach can be used to wrap other WinAPI technologies as well.