wxMSW: Add runtime checks for Windows 8+ Pointer API functions (PR #26460)

32 views
Skip to first unread message

Youcef Kouchkar

unread,
May 14, 2026, 2:50:37 PM (4 days ago) May 14
to wx-...@googlegroups.com, Subscribed

To support legacy Windows versions, this commit ensures that GetPointerType() and GetPointerPenInfo() are only invoked if available at runtime. This prevents "Procedure entry point not found" errors on Windows 7.

This adds the missing runtime checks to fix the compatibility issue introduced in 3732496 (Add support for generating wxStylusEvent for graphical tablets, 2026-02-02).


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26460

Commit Summary

  • 9032368 wxMSW: Add runtime checks for Windows 8+ Pointer API functions

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26460@github.com>

VZ

unread,
May 14, 2026, 8:18:36 PM (4 days ago) May 14
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

Thanks, I'm fine with maintaining Windows 7 compatibility as long as people are interested in it, but I'd like to do it with as little code as possible.

And AFAICS this function (wxWindow::HandlePointer()) should be only called under Windows 8+, right? So the function lookup should always succeed and thus the code could be simplified a bit by removing s_initDone and simply checking if the function pointer(s) is/are null as they shouldn't be after it's called the first time. And we also don't need to check for them below AFAICS.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26460/review/4294366772@github.com>

Youcef Kouchkar

unread,
May 17, 2026, 2:47:33 PM (2 days ago) May 17
to wx-...@googlegroups.com, Push

@tomay3000 pushed 1 commit.

  • 2479b02 Removed unnecessary `s_initDone` static bool variable and unnecessary `nullptr`


View it on GitHub or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26460/before/90323689b72cd2f39e769857225dd22d5184b186/after/2479b026af4ec5a4732e6a58a30a9ddf824c2eab@github.com>

Youcef Kouchkar

unread,
May 17, 2026, 2:48:30 PM (2 days ago) May 17
to wx-...@googlegroups.com, Subscribed
tomay3000 left a comment (wxWidgets/wxWidgets#26460)

Thanks, I'm fine with maintaining Windows 7 compatibility as long as people are interested in it, but I'd like to do it with as little code as possible.

Thank you.
I am pretty sure there are many people still using Windows 7, including me, my friends, the old PCs I am still running legacy software on...
Sure, as little code as possible is enough for me, at least it should run.

And AFAICS this function (wxWindow::HandlePointer()) should be only called under Windows 8+, right?

Right.

So the function lookup should always succeed and thus the code could be simplified a bit by removing s_initDone and simply checking if the function pointer(s) is/are null as they shouldn't be after it's called the first time.

I agree with you.
What i did the first time is just tried to follow wxWidgets coding conventions as much as possible.
This file : src/msw/window.cpp is full of s_initDone (May be it is old code!).

And we also don't need to check for them below AFAICS.

I don't trust Windows API GetProcAddress() to always succeed, do you!
Doing so, wxWidgets could explode in our faces anytime.

a better additional check would be:

    if ( !s_pfnGetPointerType || !s_pfnGetPointerPenInfo )
        return false;

Correct me if am wrong.
TIA.

Anyway I have updated the code as you suggested.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26460/c4472147734@github.com>

VZ

unread,
May 17, 2026, 2:58:07 PM (2 days ago) May 17
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26460)

I don't trust Windows API GetProcAddress() to always succeed, do you!

I do trust it to succeed under Windows 8+ where these functions are always present. I've never seen GetProcAddress() fail for an existing function and I'd extremely surprised if it ever did this.

a better additional check would be:

    if ( !s_pfnGetPointerType || !s_pfnGetPointerPenInfo )
        return false;

We can add this, but I'm fine with applying this PR just as it is (I assume it does work for you under Windows 7, I can't easily test it there any more).

Anyway I have updated the code as you suggested.

Thanks!


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26460/c4472168911@github.com>

Youcef Kouchkar

unread,
May 18, 2026, 6:55:48 AM (20 hours ago) May 18
to wx-...@googlegroups.com, Subscribed
tomay3000 left a comment (wxWidgets/wxWidgets#26460)

(I assume it does work for you under Windows 7, I can't easily test it there any more).

Confirmed. All samples are running perfectly on Windows 7 with the latest commit.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26460/c4476963742@github.com>

VZ

unread,
May 18, 2026, 10:43:39 PM (4 hours ago) May 18
to wx-...@googlegroups.com, Subscribed

Closed #26460 via 90a52aa.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26460/issue_event/25685984175@github.com>

Reply all
Reply to author
Forward
0 new messages