Windows Third-party: WinTab https://developer-support.wacom.com/hc/en-us/articles/12844524637975-Wintab This is the older but still heavily used API. Even though the API is defined by Wacom, other graphics tablet manufacturers use this same API. More here WinTab API.
Windows Built-in APIs (aka. Windows Ink)
WIN32 - GetPointerPenInfo
WPF - StylusPointProperties
UWP - PointerPointProperties
WinUI3 - UNKNOWN (As of Aug 2024 I do not think WINUI3 supports pens)
Windows resources:
Linux
GTK - GdkDevice
Qt - QTabletEvent
Web