In commctrl.h, structure NMPGSCROLL, the field fwKeys is declared with type BOOL (4 bytes) as documented on MSDN, but it seems this is wrong. According to the Windows SDK and MinGW-w64 headers this field uses WORD type (2 bytes).
If MSDN says that the type is BOOL, then we must take their word for it, unless you can point us to an alternative free documentation resource, or can provide an irrefutable test case which depends exclusively on free software tools, (in the strict sense of free, as defined by the FSF), to demonstrate that it must be otherwise.
Note that Windows SDK is not a free documentation resource, and since the mingw-w64 project is notorious for plagiarizing such non-free sources, we cannot accept their word for it either.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I've attached a test case demonstrating a pager control whose scrolling mechanism only works after changing the fwKeys field to WORD and packing the whole NMPGSCROLL structure (just change #if 0 to #if 1).
As another reference, I looked at Wine 2.1's commctrl.h: It uses the "good" version (WORD and packed).
Thanks for the test case. I will not look at Microsoft headers; nor will I look at equivalent mingw-w64 or wine headers, because both projects are notorious for their blatant disregard for Microsoft's EULA. However, on the basis of the evidence of your test case, I will take your word for it: thus, I've committed https://osdn.net/projects/mingw/scm/git/mingw-org-wsl/commits/2dcc5878a9edc9a84837638af134f4398a2730d9
BTW, there is a bug in your test case, which causes it to fail with a "Failed to create pager" diagnostic, when I try to run it on WinXP; the problem is that you've neglected to call InitCommonControlsEx() to register the ICC_PAGESCROLLER_CLASS — a mandatory requirement, according to Microsoft's current online docs. I've no idea why this bug isn't caught on Win7.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FWIW, after a protracted disappearance — yielding HTTP error 404 — of MSDN documentation for the NMPGSCROLL structured data type, it has now reappeared on docs.microsoft.com, with the fwKeys field now documented to be of type WORD. There now seems to be no doubt that this was the correct resolution.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If MSDN says that the type is BOOL, then we must take their word for it, unless you can point us to an alternative free documentation resource, or can provide an irrefutable test case which depends exclusively on free software tools, (in the strict sense of free, as defined by the FSF), to demonstrate that it must be otherwise.
Note that Windows SDK is not a free documentation resource, and since the mingw-w64 project is notorious for plagiarizing such non-free sources, we cannot accept their word for it either.
Ok, I've attached a test case demonstrating a pager control whose scrolling mechanism only works after changing the
fwKeys
field toWORD
and packing the wholeNMPGSCROLL
structure (just change#if 0
to#if 1
).As another reference, I looked at Wine 2.1's commctrl.h: It uses the "good" version (
WORD
and packed).Thanks for the test case. I will not look at Microsoft headers; nor will I look at equivalent mingw-w64 or wine headers, because both projects are notorious for their blatant disregard for Microsoft's EULA. However, on the basis of the evidence of your test case, I will take your word for it: thus, I've committed https://osdn.net/projects/mingw/scm/git/mingw-org-wsl/commits/2dcc5878a9edc9a84837638af134f4398a2730d9
BTW, there is a bug in your test case, which causes it to fail with a "Failed to create pager" diagnostic, when I try to run it on WinXP; the problem is that you've neglected to call
InitCommonControlsEx()
to register theICC_PAGESCROLLER_CLASS
— a mandatory requirement, according to Microsoft's current online docs. I've no idea why this bug isn't caught on Win7.FWIW, after a protracted disappearance — yielding HTTP error 404 — of MSDN documentation for the
NMPGSCROLL
structured data type, it has now reappeared on docs.microsoft.com, with thefwKeys
field now documented to be of typeWORD
. There now seems to be no doubt that this was the correct resolution.