Thread: what is the significance of low order and high order bits

  1. #1
    Shadow12345
    Guest

    what is the significance of low order and high order bits

    what is the significance of low order and high order bits. doesn't the WPARAM parameter of the wndproc equal the high order bits, and the LPARAM equal the low order bits?

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    When you are talking about 'bits', i'll assume you mean 'WORD's'.

    It's for backward compatibility/is a legacy from 16 bit architectures. Look up the macro definitions for HIWORD, LOWORD,HIBYTE and LOBYTE to see how they chop WPARAM's and LPARAM's (32 bit values) and WORD's(16 bit values) into smaller chunks.

    From windef.h (aug2001psdk):
    Code:
    typedef UINT_PTR            WPARAM;
    typedef LONG_PTR            LPARAM;
    or simpler from a previous version of windef.h:
    Code:
    typedef UINT WPARAM;
    typedef LONG LPARAM;
    ie WPARAM and LPARAM are defined as 32 bit values (or 64 bit on 64 bit machines when 'ULONG_PTR' is used).

    edit: formatting
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sorting using pointer to pointer not working
    By eager2no in forum C Programming
    Replies: 17
    Last Post: 09-21-2008, 12:52 AM
  2. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  3. temperature sensors
    By danko in forum C Programming
    Replies: 22
    Last Post: 07-10-2007, 07:26 PM