- I was looking at recreating NumGet and NumPut via DllCall.
- This function uses *, the dereference operator, to do NumGet, although that operator won't be available in AHK v2.
Choose naming and syntax for built-in Extract/InsertInteger - Page 2 - Suggestions - AutoHotkey Community
https://autohotkey.com/board/topic/1807 ... ntry118402
- Here's a bit of test code.
Code: Select all
q:: ;recreate NumPut
vText := "abc"
if A_IsUnicode
DllCall("ntdll\RtlFillMemory", Ptr,&vText+2, UPtr,1, UChar,Ord("B"))
, DllCall("ntdll\RtlFillMemory", Ptr,&vText+3, UPtr,1, UChar,0)
else
DllCall("ntdll\RtlFillMemory", Ptr,&vText+1, UPtr,1, UChar,Ord("B"))
MsgBox, % vText
return
w:: ;recreate NumGet (without using the dereference operator *)
vText := "abc"
VarSetCapacity(vData, 4, 0)
DllCall("kernel32\RtlMoveMemory", Ptr,&vData, Ptr,&vText, UPtr,1)
MsgBox, % Ord(vData)
return
e:: ;recreate NumGet (without using the dereference operator *)
vText := "abc"
MsgBox, % Ord(StrGet(&vText, "CP0"))
MsgBox, % Ord(StrGet(&vText+1, "CP0"))
return