I am having a Handle. The handle can be a handle to a control or a window. I want to see whether the handle is a handle to Control or a handle to window How can I do this. Is there any API for this?
A control is a window as well, but with a specific behavior (like an Edit-Control). You can use GetClassName to retrieve the class-name (for example "EDIT" for an edit-control) to see if your window-handle is some kind of control.
Originally posted by darwen
Generally speaking controls have no captions and windows do. You could provide this as your condition to find out.
I'd be careful about that. There are many windows (just think of MFC CView windows or other embedded windows, like panes) which have no caption, and still aren't controls.
You are correct gstercken, There are many windows which does not have caption. More over a window does not have a constant class name. For example a dialog have a class name "#3770", A MDI and SDI application have a dynamic classname starting with "Afx:"
Bookmarks