Thread: DispatchMessage(&msg);

  1. #1
    samurai warrior nextus's Avatar
    Join Date
    Nov 2001
    Posts
    196

    DispatchMessage(&msg);

    what i heard is that DispatchMessage calls Windows..which in turn calls the WndProc...and in the WndProc there's a switch statment...
    switch(message)
    {
    case WM_CREATE:
    return 0;
    case WM_PAINT:
    return 0;
    etc....
    }
    well how does Windows know what handle to window it is?

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    76
    The handle to the appropriate window is found in the hwnd member of the MSG structure referenced by the call to DispatchMessage. The MSG structure also contains the message ID and two message parameters that DispatchMessage sends the window.

    DispatchMessage generally handles messages posted using the PostMessage function. If the hwnd member is NULL, DispatchMessage, I presume, does nothing.

Popular pages Recent additions subscribe to a feed