I think this is what you are looking for.

Hope it is of some help

IJ



Public Function HiWord(wParam As Long) As Integer

If wParam And &H80000000 Then
HiWord = (wParam \ 65535) - 1
Else
HiWord = wParam \ 65535
End If

End Function


Public Function LoWord(wParam As Long) As Integer

If wParam And &H8000& Then
LoWord = &H8000 Or (wParam And &H7FFF&)
Else
LoWord = wParam And &HFFFF&
End If

End Function