Window Notify NMHDR\idFrom

Post bugreports for the Windows version here
User avatar
mk-soft
Always Here
Always Here
Posts: 6499
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Window Notify NMHDR\idFrom

Post by mk-soft »

If gadgets are created with #PB_Any, the wrong DialogID is entered, so the wrong IdFrom comes in the Notify NMHDR.

With X64 this is 64bit.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
breeze4me
Enthusiast
Enthusiast
Posts: 654
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: Window Notify NMHDR\idFrom

Post by breeze4me »

The issue occurs because Windows uses the GetDlgCtrlID function to obtain the control ID value, and its return value is always a 4-byte integer.
If a valid 64-bit ID value is set when a gadget is created, it is not a bug in PB.
Therefore, there is no general solution, and you must use a workaround as shown below.

Code: Select all

*hdr.NMHDR = lParam
Gadget = GetWindowLongPtr_(*hdr\hwndFrom, #GWLP_ID)
; Is it a valid PB gadget?
If GadgetID(Gadget) = *hdr\hwndFrom
  ...
EndIf
User avatar
mk-soft
Always Here
Always Here
Posts: 6499
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Window Notify NMHDR\idFrom

Post by mk-soft »

Is actually a bug in windows and not in PureBasic

Thanks for the hint ;)

Code: Select all

    Debug GetProp_(\hdr\hwndFrom, "PB_ID"); Ok
    Debug GetWindowLongPtr_(\hdr\hwndFrom, #GWLP_ID); Ok
    Debug GetDlgCtrlID_(\hdr\hwndFrom); Wrong
    Debug \hdr\idFrom; Wrong
I noticed in my ListIconGadgetEx
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply