views:

117

answers:

4

Under Windows their is something called a Windowless Control.

What is a Windowless Control and what are its benefits?

+2  A: 

This might be helpful.

Eran Betzalel
I'm looking for a high level explanation/history. Thanks for the link though.
+3  A: 

A Windowless control is an object that gives you the behavior of a control without requiring you to create a window.

This is useful when you want to modify or extend the behavior, or when you want to make use of the behavior in places where creating a window would be awkward or difficult.

Say, for instance, you want to imbed hundreds of rich edit controls on a page, if they were each windows, then each would have to get focus in order to get user input, and each would paint individually, etc.

But if you are willing to keep track of the locations of the windowless controls and do some other housekeeping that you would normally get for free by creating a window (i.e. routing keyboard messages), then you can get better results with lower overhead by using windowless controls.

John Knoeller
+1  A: 

Windowless controls do not have a dedicated window handle.

David Lively
Ok... so that defines a windowless control, but what are the benefits and uses of control without a window handle?
A: 

Anon's right. It's a control that doesn't require an underlying window handle (HWND). The need for those arose especially with web browsers, since there's a limit of 10,000 max handles per process. You would open like two tabs of semi-complicated web pages and you'd run out of handles.

Working with and especially rolling your own windowless controls is hard, because at least you need to recreate their original, sometimes very complex and tricky implementation. (f.e.: IE's listbox is still windowed control because of all the tricky intricacies)

arul