Jump to content

Blank white page rendered only in embedded IE control


Recommended Posts

Here:

$oIE.document.body.scroll = "no"
$oIE.document.body.style.overflow = "hidden"

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

That's not working with this code:

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <Constants.au3>
#include <IE.au3>

Dim $hGUI, $oIE, $sURL, $iLeft, $iTop, $iHeight, $iWidth, $i_PID

$sURL = "http://stern.de"
$iLeft = 0
$iTop = 0
$iWidth = 1024
$iHeight = 1600

$hGUI = GUICreate("Test", $iWidth, $iHeight)

$oIE = IECreatePseudoEmbedded($iLeft, $iTop, $iWidth, $iHeight, $hGUI)
_IENavigate($oIE, $sURL)
GUISetState(@SW_SHOW, $hGUI)

While GUIGetMsg() <> -3
WEnd

_IEQuit($oIE)
ProcessClose($i_PID)

While ProcessExists($i_PID)
WEnd

GUIDelete()
Exit


Func IECreatePseudoEmbedded($i_Left, $i_Top, $i_Width, $i_Height, $h_Parent, $f_ShowWin = False, $i_Timeout = 30000)

   Local Const $i_Random = Random(10001, 99999, 1)
   Local $oIE, $h_HWND, $h_Timer = TimerInit()

   $i_PID = Run(@ProgramFilesDir & "Internet Exploreriexplore.exe -k " & "about:blank-" & $i_Random, "", @SW_HIDE)

   $f_ErrorNotify = _IEErrorNotify()
   _IEErrorNotify(False)

   While Not IsObj($oIE)
     $oIE = _IEAttach("about:blank-" & $i_Random, "URL")
     If TimerDiff($h_Timer) > $i_Timeout Then
        _IEErrorNotify($f_ErrorNotify)
        Return SetError(1, 0, 0)
     EndIf
     Sleep(200)
    WEnd

    $oIE.document.body.scroll = "no"
    $oIE.document.body.style.overflow = "hidden"

   _IEErrorNotify($f_ErrorNotify)

   $h_HWND = _IEPropertyGet($oIE, "hwnd")
   $h_HWND_h = _IEPropertyGet($oIE, "height")
   ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $h_HWND_h = ' & $h_HWND_h & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console


   _WinAPI_SetParent($h_HWND, $h_Parent)
   _WinAPI_MoveWindow($h_HWND, $i_Left, $i_Top, $i_Width, $i_Height, True)
   _WinAPI_SetWindowLong($h_HWND, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE)

   If $f_ShowWin Then
     WinSetState($h_HWND, "", @SW_SHOW)
   EndIf

   Return $oIE

EndFunc   ;==>IECreatePseudoEmbedded

The height of the IE window is fixed at 1050 pixels whereas the GUI is set to 1600.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <Constants.au3>
#include <IE.au3>

Dim $hGUI, $oIE, $sURL, $iLeft, $iTop, $iHeight, $iWidth, $i_PID

$sURL = "http://stern.de"
$iLeft = 0
$iTop = 0
$iWidth = 1024
$iHeight = 1600

$hGUI = GUICreate("Test", $iWidth, $iHeight)

$oIE = IECreatePseudoEmbedded($iLeft, $iTop, $iWidth, $iHeight, $hGUI)
ObjEvent($oIE, "_IEEvent_", "DWebBrowserEvents2")
_IENavigate($oIE, $sURL)

GUISetState(@SW_SHOW, $hGUI)

While GUIGetMsg() <> -3
WEnd

_IEQuit($oIE)
ProcessClose($i_PID)

While ProcessExists($i_PID)
WEnd

GUIDelete()
Exit

Func IECreatePseudoEmbedded($i_Left, $i_Top, $i_Width, $i_Height, $h_Parent, $f_ShowWin = False, $i_Timeout = 30000)
   Local Const $i_Random = Random(10001, 99999, 1)
   Local $oIE, $h_HWND, $h_Timer = TimerInit()
   $i_PID = Run(@ProgramFilesDir & "Internet Exploreriexplore.exe -k " & "about:blank-" & $i_Random, "", @SW_HIDE)
   $f_ErrorNotify = _IEErrorNotify()
   _IEErrorNotify(False)
   While Not IsObj($oIE)
     $oIE = _IEAttach("about:blank-" & $i_Random, "URL")
     If TimerDiff($h_Timer) > $i_Timeout Then
        _IEErrorNotify($f_ErrorNotify)
        Return SetError(1, 0, 0)
     EndIf
     Sleep(200)
    WEnd
   _IEErrorNotify($f_ErrorNotify)
   $h_HWND = _IEPropertyGet($oIE, "hwnd")
   $h_HWND_h = _IEPropertyGet($oIE, "height")
   ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $h_HWND_h = ' & $h_HWND_h & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
   _WinAPI_SetParent($h_HWND, $h_Parent)
   _WinAPI_MoveWindow($h_HWND, $i_Left, $i_Top, $i_Width, $i_Height, True)
   _WinAPI_SetWindowLong($h_HWND, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE)
   If $f_ShowWin Then
     WinSetState($h_HWND, "", @SW_SHOW)
   EndIf
   Return $oIE
EndFunc   ;==>IECreatePseudoEmbedded

Func _IEEvent_NavigateComplete2($ptrBrowser, $ptrURL)
$oIE.document.body.scroll = "no"
$oIE.document.body.style.overflow = "hidden"
EndFunc   ;==>_IEEvent_NavigateComplete2

Edited by rover

I see fascists...

Link to comment
Share on other sites

It is not clear to me what you are saying isn't working, but based on @rover's solution, the page loads have to be complete before the command I gave you will work.

@rover's code looks good -- this can also be done by calling _IELoadWait() prior to trying to remove the scrollbars.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Ok, maybe I should give some more background infomation what I'm trying to do.

In the tool "Windows Screenshooter" you have the option to screenshot a web site that means the web site will be rendered embedded in a gui and the gui will be screenshot afterwards.

This works properly when Aero is enabled but an issue is when the ActiveX control size (height) is larger than 8192 pixel and IE9 is used, the rendered web site within the gui is just blank white. That's the reason why I opened this topic.

One workaround might the solution you provided in the code from post#22 but the web site will not be rendered using the full height instead there are scroll bars and the height is limited to 1050 pixels. I know that this example site has a large height size.

I know further that is much better but I started this way for now...

I hope this gives more information.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I've read it many times, but I just can't figure out what you mean by: "but the web site will not be rendered using the full height instead there are scroll bars and the height is limited to 1050 pixels". Do you mean the scroll bars are not going away, or they are, but you are not given the real estate back or what????

Dale

Also, have a look at http://knowledgeinbox.com/downloads/general/screen-capture-and-comparison-com-api/

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

This is how it looks like: http://imageshack.us/photo/my-images/84/test1oz.jpg/

And this here how it should look like: http://imageshack.us/photo/my-images/521/test2ct.jpg/ where is image has been cut off at 8190 pixel height.

I don't know how I should explain it...

Btw, 1050 pixel height is the height of my desktop using ext. monitor.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...