Compartir a través de


IDM_IE50_PASTE

Performs a paste operation compatible with Microsoft Internet Explorer 5.

TBD

Remarks

The pvaIn parameter specifies an HGLOBAL handle that represents the NULL-terminated content buffer containing one of the following:

  • A CHAR buffer of non-Unicode content
  • A WCHAR buffer of Unicode content, with signature prefix (0xFEFF on little-endian machine)

Examples

The following example inserts "Test" into a text field (IHTMLInputTextElement).

static OLECHAR str[] = L"\xFEFFTest";
// (ASCII) static char str[] = "Test";
 
CComPtr<IHTMLTxtRange> pIRange;
if (SUCCEEDED(pIInputText->createTextRange(&pIRange)))
{
    CComQIPtr<IOleCommandTarget> pICT = pIRange;
    if (NULL != pICT)
    {
        HGLOBAL hStr = ::GlobalAlloc(GMEM_FIXED, sizeof(str));
 
        if (NULL != hStr)
        {
            if (SUCCEEDED(::StringCbCopyW((LPWSTR)hStr, sizeof(str), str)))
                // (ASCII)::StringCbCopyA((LPSTR)hStr, sizeof(str), str))
            {
                VARIANT varIn;
                varIn.byref = hStr;
                varIn.vt = VT_BYREF;
 
                pICT->Exec(&CGID_MSHTML,
                            IDM_IE50_PASTE,
                            OLECMDEXECOPT_DONTPROMPTUSER,
                            &varIn,
                            NULL);
            }
            ::GlobalFree(hStr);
        }
    }
}

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mshtmcid.h

See also

Modifying Documents in Edit Mode