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?
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.
Quote:
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.
Re: Windows Messaging in Common Controls
Thanks again Igor, I see how now ;)