in reply to Re^2: x64 Win32::GUI TreeView broken, question and "fix" included
in thread x64 Win32::GUI TreeView broken, question and "fix" included
Yeah, the negative inte value gets cast to a ULONG_PTR, which is an unsigned integral type whose size is big enough to hold a pointer value -- an unsigned long in x86 builds and an unsigned __int64 (equivalent to unsigned long long) with x64. So with this cast, on x64, the negative int value is sign-extended and all upper bits in the ULONG_PTR end up being set to 1. HTREEITEM is actually a typedef of a pointer to a unique dummy struct type, so it is the same size as ULONG_PTR.