2.2.6.9.2 DhtmlControl::CreateControl


Version

Minimum Origin Version Required: Origin 9.1 SR0

Description

Creates a HTML child window


Creates a HTML child window

Syntax

BOOL CreateControl( HWND hWndParent, RECT * lpRect, int nID, DWORD dwStyle = 0 )


BOOL CreateControl( HWND hWndReplace, DWORD dwStyle = 0 )

Parameters

hWndParent
[input]A handle to the parent or owner window of the window being created
lpRect
[input]The size and location of the window relative to the top-left corner of the parent window.
nID
[input]ID of the window.
dwStyle
[input]The window style.


hWndReplace
[input]A handle to the existing window as a placeholder, the created
window will destroy it and place at the same location and size of it.
dwStyle
[input]The window style.

Return

Returns TRUE on success, FALSE on failure.


Returns TRUE on success, FALSE on failure.

Examples

EX1

#include <Control.h>
void CreateControl_ex1(DhtmlControl& dhtmlctrl, Window& dlgParent)
{
    RECT rect = {0,0,500,500};
    dhtmlctrl.CreateControl(dlgParent.GetSafeHwnd(), &rect, 100);
}


EX2

#include <Control.h>
#define IDC_MY_HTML_PLACEHOLDER        100

void CreateControl_ex2(DhtmlControl& dhtmlctrl, Window& dlgParent)
{
    Control ctrl = dlgParent.GetDlgItem(IDC_MY_HTML_PLACEHOLDER);
    dhtmlctrl.CreateControl(ctrl.GetSafeHwnd());
}

Remark

See Also

Header to Included

Control.h