There also is an annoying bug in more recent Windows 10 versions which surfaces
with subclassed Scrollbar-class, i.e. Visual Basic 3 ThunderHScrollBar class:
Upon creation, in WM_NCCREATE, an address is set at the end of the Window's
extra bytes. Currently the Thunder* classes of VB allocate the number of bytes
from the control they are subclassing and add an additional 6 bytes at the end.
So for instance,in my tests, the "Scrollbar" Window clas has 0x50 bytes, so 0x56 bytes get allocated.
In WM_NCCREATE, an address is set at the first place of these additional bytes allocated, so at 0x56 - 6 = 0x50:
This Long gets set at the correct place (@0x50)
However, in newer Windows verisons, there is some strange value at tagWND + 0xFC that gets subtracted from the GetWindowLong Index upon retrieval. As mentioned, in WM_NCCREATE the value gets set et the correct place, so this tagWND + 0xFC value is 0.
However, in WM_CREATE, the value suddenly gets set to 0x50 (The code that does this hasn't been found yet, as it thunks out to 64bit world in user32.dll: _ScrollBarWndProcWorker --> NtUserMessageCall), so when the value gets retrieved later, it is read from 0x00, instead of 0x05, so it returns 0 and VB.EXE crashes in turn:
As MS was stupid enough to pull the tagWND definition from their symbols, it still remains unclear what this value is good for and where it gets used, thus, the bug cannot be fixed. Therefore it is recommended to use earlier Windows versions which don't suffer from this bug.
There also is an annoying bug in more recent Windows 10 versions which surfaces with subclassed Scrollbar-class, i.e. Visual Basic 3 ThunderHScrollBar class: Upon creation, in WM_NCCREATE, an address is set at the end of the Window's extra bytes. Currently the Thunder* classes of VB allocate the number of bytes from the control they are subclassing and add an additional 6 bytes at the end. So for instance,in my tests, the "Scrollbar" Window clas has 0x50 bytes, so 0x56 bytes get allocated. In WM_NCCREATE, an address is set at the first place of these additional bytes allocated, so at 0x56 - 6 = 0x50:
This Long gets set at the correct place (@0x50) However, in newer Windows verisons, there is some strange value at tagWND + 0xFC that gets subtracted from the GetWindowLong Index upon retrieval. As mentioned, in WM_NCCREATE the value gets set et the correct place, so this tagWND + 0xFC value is 0. However, in WM_CREATE, the value suddenly gets set to 0x50 (The code that does this hasn't been found yet, as it thunks out to 64bit world in user32.dll: _ScrollBarWndProcWorker --> NtUserMessageCall), so when the value gets retrieved later, it is read from 0x00, instead of 0x05, so it returns 0 and VB.EXE crashes in turn:
As MS was stupid enough to pull the tagWND definition from their symbols, it still remains unclear what this value is good for and where it gets used, thus, the bug cannot be fixed. Therefore it is recommended to use earlier Windows versions which don't suffer from this bug.