function TPoto_capture.Get_IHTMLDocument2: IHTMLDocument2;
var
pIOleObject : IOleObject;
pIOleClient : IOleClientSite;
pIOleContainer : IOleContainer;
pDOC : IHTMLDocument2;
pUnk : IUnknown;
begin
Result := nil;
pUnk := ComObject;
if Assigned( pUnk ) then
if SUCCEEDED(pUnk.QueryInterface(IOleObject, pIOleObject)) and Assigned( pIOleObject ) then
if SUCCEEDED(pIOleObject.GetClientSite(pIOleClient)) and Assigned( pIOleClient ) then
if SUCCEEDED(pIOleClient.GetContainer(pIOleContainer)) and Assigned( pIOleContainer ) then
if SUCCEEDED( pIOleContainer.QueryInterface(IHTMLDocument2,pDOC)) and Assigned(pDOC) then begin
Result := pDoc;
end;
end;
function TPoto_capture.Get_IHTMLDocument2: IHTMLDocument2;
var
pIOleObject : IOleObject;
pIOleClient : IOleClientSite;
pIOleContainer : IOleContainer;
pDOC : IHTMLDocument2;
pUnk : IUnknown;
begin
Result := nil;
pUnk := ComObject;
if Assigned( pUnk ) then
if SUCCEEDED(pUnk.QueryInterface(IOleObject, pIOleObject)) and Assigned( pIOleObject ) then
if SUCCEEDED(pIOleObject.GetClientSite(pIOleClient)) and Assigned( pIOleClient ) then
if SUCCEEDED(pIOleClient.GetContainer(pIOleContainer)) and Assigned( pIOleContainer ) then
if SUCCEEDED( pIOleContainer.QueryInterface(IHTMLDocument2,pDOC)) and Assigned(pDOC) then begin
Result := pDoc;
end;
end;
이걸 사용하시면 되요
저는 잘 사용하고 있어요