NO

Author Topic: Richedit tips  (Read 2875 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Richedit tips
« on: October 31, 2018, 05:18:08 PM »
Missing TOM.h ?
You can create it from riched20.dll / msftedit.dll and rename it to tom.h

After that you can
Code: [Select]
SendMessage(hREdit, EM_GETOLEINTERFACE, 0, (LPARAM)&pRichEditOle);
HRESULT hr = pRichEditOle->lpVtbl->QueryInterface(pRichEditOle, &IID_ITextDocument, (void **)&pDocument);
and
Code: [Select]
VARIANT v;
v.vt = VT_BSTR;
v.bstrVal = SysAllocString(szFileName);
HRESULT hr = pDocument->lpVtbl->Open(pDocument, &v, 0x30, 0); // 0x30 tomOpenExisting
SysFreeString(v.bstrVal);
EDIT: Windowless RE with msftedit.dll 32-bit, by faking __thiscall with __fastcall :D
« Last Edit: November 01, 2018, 10:17:09 PM by TimoVJL »
May the source be with you