OK, first I get a handle to the "Internet Explorer_Server" window in the current running instance of IE and I pass it to the code below (provided by Freak)
Code: Select all
Procedure.l GetIHTMLDocument2(ExplorerServerWindow)
HtmlDoc.IHTMLDocument2 = 0
OleAcc = OpenLibrary(#PB_Any, "OLEACC.DLL")
If OleAcc And IsFunction(OleAcc, "ObjectFromLresult")
Message = RegisterWindowMessage_("WM_HTML_GETOBJECT")
SendMessageTimeout_(ExplorerServerWindow, Message, 0, 0, #SMTO_ABORTIFHUNG, 1000, @MessageResult)
CallFunction(OleAcc, "ObjectFromLresult", MessageResult, ?IID_IHTMLDocument2, 0, @HtmlDoc)
CloseLibrary(OleAcc)
EndIf
ProcedureReturn HtmlDoc
EndProcedure
This works great and I do end up with a pointer to the IHTMLDocument2 interface.
From there I'm just simply trying to run the code:
Code: Select all
iCopy.l = ANSI2BSTR("Copy")
If Document2\execCommand(iCopy,#False,0,0) = #S_OK
When all is said and done, more is said than done.