|
-
Aug 10th, 2000, 01:25 PM
#1
Thread Starter
Fanatic Member
HIWORD and LOWORD equivalents
I was looking through a C++ file and saw that to find the high-order bit of a value, like wParam or lParam, they used HIWORD and to find the low-order bit they used LOWORD.
(At least, that's what I assume these functions do )
I think to find the HIWORD - equivalent in VB you use &HFFFF (I'm not sure how many f's) but I don't know if this is what you use for the LOWORD, or it is the other way around or maybe you use
God this is starting to sound like an Eminem single.
Okay. How do you find the HIWORD and LOWORD of a value?
-
Aug 10th, 2000, 02:33 PM
#2
Lively Member
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
-
Aug 10th, 2000, 08:08 PM
#3
Monday Morning Lunatic
BTW, HIWORD and LOWORD are macros (note the capital letters - instant giveaway), and you can get at the definitions (I think they're in winbase.h).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 11th, 2000, 08:21 AM
#4
Thread Starter
Fanatic Member
macros, shmacros
Thanks for the help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|