Thread: The return value from WndProc

  1. #16
    Registered User
    Join Date
    Mar 2011
    Posts
    596
    What qualifies as processing a message?

    I would assume it's more than just adding a case for it in the switch?

    Code:
    case WM_LBUTTONDOWN :
        return 0;
    But would this be considered processing:

    Code:
    case WM_LBUTTONDOWN :
        counter++;
        return 0;
    Why would the caller to WndProc (the operating system?) be interested in that example?

  2. #17
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by megafiddle View Post
    What qualifies as processing a message?

    I would assume it's more than just adding a case for it in the switch?

    Code:
    case WM_LBUTTONDOWN :
        return 0;
    Yes, that is you doing something with the message... in this case you are preventing it from being passed on to the DefWindowProc(). (A common use is with WM_ERASEBACKGROUND to prevent flickering on the screen)


    But would this be considered processing:

    Code:
    case WM_LBUTTONDOWN :
        counter++;
        return 0;
    Why would the caller to WndProc (the operating system?) be interested in that example?
    The thing is that it's sending you the message and you are not passing it on to DefWindowProc(), and returning 0, so as far as the OS is concerned, you've done something with the message so it won't process it any further. If you returned 1 instead of 0 it will continue to process the message after the switch returns.
    Last edited by CommonTater; 09-12-2011 at 12:39 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WNDPROC conversion
    By kidburla in forum Windows Programming
    Replies: 5
    Last Post: 09-18-2006, 01:06 PM
  2. WndProc Hook - Help
    By Mastadex in forum Windows Programming
    Replies: 0
    Last Post: 05-15-2006, 03:13 PM
  3. my wndProc is out of scope
    By Raison in forum Windows Programming
    Replies: 35
    Last Post: 06-25-2004, 07:23 AM
  4. Wndproc
    By Unregistered in forum Windows Programming
    Replies: 6
    Last Post: 08-12-2002, 04:33 PM
  5. Getting WndProc
    By DutchStud in forum Windows Programming
    Replies: 3
    Last Post: 11-02-2001, 07:17 AM