I'm trying to get the RTF data out of a richeditcontrol. Couldn't find an easy way so i'm trying to use Interop.
so far i have:
code:
function OnWndMainEvent_CtrlClicked(PlusWnd, ControlId)
{
if (ControlId == "BtnSend")
{
var SF_RTF = 0x2
var SF_UNICODE = 0x10
var WM_USER = 0x400
var EM_STREAMOUT = (WM_USER + 74)
var len = PlusWnd.GetControlText("CodeBox").length;
var editStream = Interop.Allocate(24)
editStream.WriteDWORD(0,0)
editStream.WriteDWORD(8,0)
editStream.WriteDWORD(16,Interop.GetCallbackPtr("EditStreamCallback"))
var lResult = Interop.Call2("user32.dll", "SendMessageW", PlusWnd.GetControlHandle(ControlId), EM_STREAMOUT, SF_RTF || SF_UNICODE, editStream )
Debug.Trace("result: " + lResult)
}
}
function EditStreamCallback(dwCookie, lpBuff, cb, pcb)
{
}
I've probably done this all wrong so any help is appreciated.