Page 1 of 1

Window Notify NMHDR\idFrom

Posted: Sat Jan 17, 2026 4:54 pm
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.

Re: Window Notify NMHDR\idFrom

Posted: Sun Jan 18, 2026 7:32 am
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

Re: Window Notify NMHDR\idFrom

Posted: Sun Jan 18, 2026 12:56 pm
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