CComControl::CreateControlWindow

By default, creates a window for the control by calling CWindowImpl::Create.

virtual HWND CreateControlWindow(
   HWND hWndParent,
      RECT& rcPos 
);

Parameters

  • hWndParent
    [in] Handle to the parent or owner window. A valid window handle must be supplied. The control window is confined to the area of its parent window.

  • rcPos
    [in] The initial size and position of the window to be created.

Remarks

Override this method if you want to do something other than create a single window, for example, to create two windows, one of which becomes a toolbar for your control.

Example

RECT rc = {10,10,210,110};
HWND hwndParent, hwndControl;

// get HWND of control's parent window from IOleInPlaceSite interface
m_spInPlaceSite->GetWindow(&hwndParent);
hwndControl = CreateControlWindow(hwndParent, rc);

Requirements

Header: atlctl.h

See Also

Concepts

CComControl Class

CComControl Members

CWindowImpl::Create