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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Returning LRESULT in DefWindowProc()

Returning LRESULT in DefWindowProc()

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 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.
  • V Offline
    V Offline
    VFaul
    wrote on last edited by
    #1

    I have a DefWindowProc() function to catch unhandled messages. This function returns an LRESULT. I have a switch statement and in some cases I call CWnd::DefWindowProc(). So I simply return the result of the call to CWnd::DefWindowProc(). In other cases, I handle the message. What should the value of LRESULT be when I handle the message?

    PJ ArendsP D 2 Replies Last reply
    0
    • V VFaul

      I have a DefWindowProc() function to catch unhandled messages. This function returns an LRESULT. I have a switch statement and in some cases I call CWnd::DefWindowProc(). So I simply return the result of the call to CWnd::DefWindowProc(). In other cases, I handle the message. What should the value of LRESULT be when I handle the message?

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      Depends on the message. The documentation will tell you if the message needs a certain return value. If it does not then simply return zero.


      You may be right
      I may be crazy
      -- Billy Joel --

      Within you lies the power for good, use it!!!

      Within you lies the power for good; Use it!

      1 Reply Last reply
      0
      • V VFaul

        I have a DefWindowProc() function to catch unhandled messages. This function returns an LRESULT. I have a switch statement and in some cases I call CWnd::DefWindowProc(). So I simply return the result of the call to CWnd::DefWindowProc(). In other cases, I handle the message. What should the value of LRESULT be when I handle the message?

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Per MSDN: The return value is the result of the message processing and depends on the message sent.


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        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