Try this sometime: open up MSN Messenger (the latest), and also open up Spy++ and try to spy, say, the text box you type into during conversations. What you'll find is that you can't, there is no 'textbox' registered with windows that you type into, and the same goes for the button you push when you want to send a message, there is no real button that exists there either; in fact, there is only one window registered with windows (that is, that has a valid window handle or HWND) in a messenger conversation window and its of type DirectUIHWND. I discovered this because I was trying to hook messages to some of the textboxes in the messenger conversation window manually, but was unable to since they didn't exist. All the windows that I would want to spy on are windowless controls, and they've been around a long, long time. Now, I forgot all about them, so I assume others may have too; the basic gist on windowless controls is:
- They are windowless: meaning they have no handle registered with windows and therefore are not known to Windows and cannot receive messages.
- They require the device context of their parent to actually draw themselves or, as is known in the ActiveX world, 'activate' themselves (that is, gain contextual information from the parent and start rendering themselves out).
- They are COM objects and are activated on their container site; meaning there is a full-fledged parent/child relationship that exists between their container and themselves (they register themselves with the container, so the container is aware of them and vice versa).
- They request the drawing surface or Device context (DC) of their parent and use that to draw themselves onto.
- If they are activated upon a container that isn't aware of windowless controls, then they must register themselves with windows and become a fully fledge windows control.
The parent (container) must implement IOleInPlaceSiteWindowless and the windowless control itself must impement IOleInPlaceObjectWindowless for all the proper comunication between them to occur. So....what does all this mean? Well, for me it means it's going to be very difficult (near impossible) to hook messages meant for various child controls of the messenger conversation window (SUCK), for the rest of us it simply means a more effecient experience as windows aren't being created and destroyed using the infrastructure of the operating system itself, but instead using a light-weight mechanism internal to themselves. For more information, see this MSDN page.