STDMETHODIMP touchmind::control::DWriteEditControlTextStoreACP::SetText(DWORD dwFlags, LONG acpStart, LONG acpEnd,
                                                                        const WCHAR *pchText, ULONG cch,
                                                                        TS_TEXTCHANGE *pChange) {
  UNREFERENCED_PARAMETER(dwFlags);

  HRESULT hr = S_OK;

  TS_SELECTION_ACP tsa;
  tsa.acpStart = acpStart;
  tsa.acpEnd = acpEnd;
  tsa.style.ase = TS_AE_START;
  tsa.style.fInterimChar = FALSE;

  hr = SetSelection(1, &tsa);

  if (SUCCEEDED(hr)) {
    hr = InsertTextAtSelection(TS_IAS_NOQUERY, pchText, cch, nullptr, nullptr, pChange);
  }
  return hr;
}
STDAPI CInsertHelloEditSession::DoEditSession(TfEditCookie ec)
{
    InsertTextAtSelection(ec, _pContext, L"Hello world!", (ULONG)wcslen(L"Hello world!"));
    return S_OK;
}