WndToNativeDocument - web automation method

Not available in Open Twebst edition!
Retrieves a native HTML document object ( IHTMLDocument2 ) from a Internet Explorer_Server Win32 window handle.

Applies to:
  var nativeDoc = core.WndToNativeDocument(ieWndHandle);
ieWndHandle parameter is the handle of a Internet Explorer_Server window hosted by any application. This IE automation method can be useful if you already have a handle of a browser control hosted inside a .Net WinForms application and you need to access the HTML document. In case of an error the method throws a web automation exception and the lastError property of the core object is set as follows:
// Assume ieWnd it is a valid handle to a 'Internet Explorer_Server' window.
var ieWnd     = 0xA10AF0;
var coreObj   = new ActiveXObject("Twebst.Core");
var nativeDoc = coreObj.WndToNativeDocument(ieWnd);

WScrip.Echo("The document size is: " + nativeDoc.fileSize);
See also:
AttachToWnd | Core | document | ieWindow | nativeBrowser | tabWindow | topWindow

© 2014 CodeCentrix Software. All rights reserved.