CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2005
    Posts
    767

    Windows Messaging in Common Controls

    Hello Everybody,
    These days I have been trying to look deep into Windows while I debug an application. I see that especially in Common Controls messaging (SendMessage / PostMessage) is used to complete a operation say GetItemData for Combo Box ends with sending a message CB_GETITEMDATA.

    My question is why such an approach used? Is it not feasible to call the message handler directly? If not how do you reach the message handler in such a case?
    One's mistake cannot be your excuse!

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: Windows Messaging in Common Controls

    I'm not perfectly sure if i'm getting the essense of your doubts, but everything in windows controls' operation invocation typically ends in sending a proper message. This is the way the Windows API does the things. And MFC (or any other OOP wrapper library) just obscures/incapsulates the actual low-level details.

    Is it not feasible to call the message handler directly?
    There is no way to obtain item data directly. This is the underlying control window who actually returns the information, and sending that message is the only way to instruct the control about doing that.
    Best regards,
    Igor

  3. #3
    Join Date
    Jul 2005
    Posts
    767

    Re: Windows Messaging in Common Controls

    Thanks again Igor, I see how now
    One's mistake cannot be your excuse!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured