Returns the LoWord (the least significant 2 bytes) from a 4-byte DoubleWord (aka Long).
Code
LoWord01
Public Function LoWord01(lDWord As Long) As Integer
If lDWord And &H8000& Then
LoWord01 = lDWord Or &HFFFF0000
Else
LoWord01 = lDWord And &HFFFF&
End If
End Function
LoWord02
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
(pDst As Any, pSrc As Any, ByVal ByteLen As Long)
Public Function LoWord02(lDWord As Long) As Integer
CopyMemory LoWord02, lDWord, 2&
End Function