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.
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:"