LOWORD,HIWORD,lParam,etc...

This is a discussion on LOWORD,HIWORD,lParam,etc... within the Windows Programming forums, part of the Platform Specific Boards category; I am starting to program using the windows GDI and am wondering what are LOWORD, HIWORD, lParam, and wParam? I ...

  1. #1
    Perverted unanimous's Avatar
    Join Date
    Oct 2001
    Posts
    336

    Question LOWORD,HIWORD,lParam,etc...

    I am starting to program using the windows GDI and am wondering what are LOWORD, HIWORD, lParam, and wParam?
    I have seen them a lot but have no idea what they do.
    Give me a bad reputation!!!

  2. #2
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    If you dont know what HIWORD and LOWORD do and you dont know what lParam, and wParam are then I dont think you should be trying to learn GDI, instead you should learn about the Win32 API.
    "only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein

  3. #3
    Perverted unanimous's Avatar
    Join Date
    Oct 2001
    Posts
    336

    Post ....

    Well, I know what a word is- a 16 bit unsifned integer, I know that HIWORD takes the high order word from a 32 bit value and LOWORD takes the lower order. I just don't understand what what the higher and lower order are.
    Give me a bad reputation!!!

  4. #4
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    Well the Win32 API uses bitpacking in the wParam and lParam to fit extra information about the message into the params passed to your WndProc. You extract this information using the HIWORD and LOWORD macros.
    "only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein

  5. #5
    Perverted unanimous's Avatar
    Join Date
    Oct 2001
    Posts
    336

    Post ok

    So does HIWORD acces the first half and LOWORD access the second half?

    lParam:

    (---------HIWORD --------)Message(---------LOWORD---------)
    Give me a bad reputation!!!

  6. #6
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    Here, direct from MSDN:
    HIWORD:
    HIWORD
    The HIWORD macro retrieves the high-order word from the given 32-bit value.

    WORD HIWORD(
    DWORD dwValue // value from which high-order word is retrieved
    );

    Parameters
    dwValue
    Specifies the value to be converted.
    Return Values
    The return value is the high-order word of the specified value.

    Remarks
    The HIWORD macro is defined as follows:

    #define HIWORD(l) ((WORD) (((DWORD) (l) >> 16) & 0xFFFF))
    LOWORD:
    LOWORD
    The LOWORD macro retrieves the low-order word from the given 32-bit value.

    WORD LOWORD(
    DWORD dwValue // value from which low-order word is retrieved
    );

    Parameters
    dwValue
    Specifies the value to be converted.
    Return Values
    The return value is the low-order word of the specified value.

    Remarks
    The LOWORD macro is defined as follows:

    #define LOWORD(l) ((WORD) (l))
    "only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein

  7. #7
    Perverted unanimous's Avatar
    Join Date
    Oct 2001
    Posts
    336

    Post thanx

    thanx
    Give me a bad reputation!!!

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21