Thread: scrollbar

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    my compilers cannot use LOWORD i have both msvc6 and dev++
    can i set the words manually?
    maybe with MAKEWORD();

  2. #2
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    my compilers cannot use LOWORD i have both msvc6 and dev++
    Hmm, well I know msvc does support that macro, it sounds like you might have something weird going on there. However it doesn't matter who needs macros anyway?

    Lets go over some definitions first because it sounds like maybe you might have some misunderstanding along the way.

    1. DWORD: 32 bit unsigned short integer
    2. WORD: 16 bit unsigned short integer

    Thus a DWORD can be treated as 2 WORDs stuck together:

    DWORD = (WORD)(WORD).

    Now with that in mind lets take a look at how these macros are defined in WinDef.h

    Code:
    #define LOWORD(l)           ((WORD)((DWORD_PTR)(l) & 0xffff))
    #define HIWORD(l)           ((WORD)((DWORD_PTR)(l) >> 16))
    Thus you can see that it is simply a bit manipulation to obtain the 16 bit value from the 32 bit value.


    Gotta go, my daughter just woke up.

    happy coding!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C win32 API - Scrollbar won't work
    By Matt-Stevens in forum Windows Programming
    Replies: 2
    Last Post: 08-03-2006, 09:05 PM
  2. Scrollbar Control Problem
    By Vicious in forum Windows Programming
    Replies: 0
    Last Post: 11-20-2005, 04:53 PM
  3. edit control scrollbar colour
    By underthesun in forum Windows Programming
    Replies: 1
    Last Post: 02-19-2005, 06:32 AM
  4. My first scrollbar
    By IAmRegistered in forum Windows Programming
    Replies: 5
    Last Post: 07-18-2003, 09:28 AM
  5. sending messages to a scrollbar
    By stormbringer in forum Windows Programming
    Replies: 1
    Last Post: 05-16-2003, 12:32 PM