Witam mam pytanie
W jaki sposób mogę pobrać źródło strony załadowanej do kontrolki Internet Explorer_Server
znając tylko jej uchwyt ? Wiem że jest to możliwe , widzalem kiedyś lod odczytujący źródło otwartej strony w IE ale niestety nie dzałał on już dla innych aplikacji korzystających z Internet Explorer_Server .
znalazłem coś takiego :
function GetIEFromHWND(WHandle: HWND; var IE: IWebbrowser2): HRESULT;
var
hInst: HWND;
lRes: Cardinal;
MSG: Integer;
pDoc: IHTMLDocument2;
ObjectFromLresult: TObjectFromLresult;
begin
hInst := LoadLibrary('Oleacc.dll');
@ObjectFromLresult := GetProcAddress(hInst, 'ObjectFromLresult');
if @ObjectFromLresult <> nil then begin
try
MSG := RegisterWindowMessage('WM_HTML_GETOBJECT');
SendMessageTimeOut(WHandle, MSG, 0, 0, SMTO_ABORTIFHUNG, 1000, lRes);
Result := ObjectFromLresult(lRes, IHTMLDocument2, 0, pDoc);
if Result = S_OK then
(pDoc.parentWindow as IServiceprovider).QueryService(IWebbrowserApp, IWebbrowser2, IE);
finally
FreeLibrary(hInst);
end;
end;
end;
Ale nie wiem jak teraz odczytać zawartośc IE ?