Why is it inconsistent when using structures as dllcall's arguments

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
thqby
Posts: 406
Joined: 16 Apr 2021, 11:18
Contact:

Why is it inconsistent when using structures as dllcall's arguments

22 Sep 2021, 04:29

This is ahk code.

Code: Select all

VarSetCapacity(variant, 8+A_PtrSize*2, 0)
NumPut(VT_I4 := 3, variant, 0, "ushort")
NumPut(UIA_EditControlTypeId := 50004, variant, 8, "int")
if (A_PtrSize = 4)
   DllCall(NumGet(NumGet(IUIAutomation+0)+23*A_PtrSize), "ptr", IUIAutomation, "int", UIA_ControlTypePropertyId := 30003, "int64", NumGet(variant, 0, "int64"), "int64", NumGet(variant, 8, "int64"), "ptr*", condition2)
else
   DllCall(NumGet(NumGet(IUIAutomation+0)+23*A_PtrSize), "ptr", IUIAutomation, "int", UIA_ControlTypePropertyId := 30003, "ptr", &variant, "ptr*", condition2)
WINAPI Header definition: IUIAutomation::CreatePropertyCondition(PROPERTYID propertyId, VARIANT value, IUIAutomationCondition **newCondition)
I know that the structure can be split into multiple corresponding values and passed to the dllcall, why is the 64 bit passed into the pointer?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 389 guests