Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. what this does

what this does

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ahmad
    wrote on last edited by
    #1

    HI ALL My question about HIWORD and LOWORD ? I'm always see LOWORD (wParam) // in WndProc function some Data Types like WPARAM , LPARAM ,DWORD have LOWORD and HIWORD value I found in MSDN about HIWORD and LOWORD it tell me it's macros like #define HIWORD(l) ((WORD) (((DWORD) (l) >> 16) & 0xFFFF)) #define LOWORD(l) ((WORD) (l)) but I can't understand what this mean and what this does can you tell me please ...

    R 1 Reply Last reply
    0
    • A Ahmad

      HI ALL My question about HIWORD and LOWORD ? I'm always see LOWORD (wParam) // in WndProc function some Data Types like WPARAM , LPARAM ,DWORD have LOWORD and HIWORD value I found in MSDN about HIWORD and LOWORD it tell me it's macros like #define HIWORD(l) ((WORD) (((DWORD) (l) >> 16) & 0xFFFF)) #define LOWORD(l) ((WORD) (l)) but I can't understand what this mean and what this does can you tell me please ...

      R Offline
      R Offline
      RockNix
      wrote on last edited by
      #2

      Thats simple: usually u use a command like (HIWORD)(lParam) ! That means you want to have the upper 16 Bit from 32. To get them you have to shift right 16 (>>16) times and mask out the upper 16 Bit ( & 0x0000ffff ). To get (LOWORD)(lParam) you have to clear the upper 16 Bit. Converting to a new type WORD from DWORD takes only the lower 16 Bit. The effect is the same. Hope it helps Greatings Mario/// -------------------- www.klangwerker.de rocknix@lycos.de --------------------

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups