Sign in to follow this  
Followers 0
UEZ

Blank white page rendered only in embedded IE control

27 posts in this topic

#21 ·  Posted

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

Share this post


Link to post
Share on other sites



#22 ·  Posted

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!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

#23 ·  Posted (edited)

#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...

Share this post


Link to post
Share on other sites

#24 ·  Posted

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

Share this post


Link to post
Share on other sites

#25 ·  Posted (edited)

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!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

#26 ·  Posted

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

Share this post


Link to post
Share on other sites

#27 ·  Posted (edited)

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!
¯\_(ツ)_/¯

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • PINTO1927
      png with background transparent into gui without border
      By PINTO1927
      Hi guys, I would like to make a gui borderless viewing a png image with transparent background.
       
      pretty much has to be visible only the png image with no background..you have any simple example?
      Thank's
      GUICtrlCreatePic  
      still it provides the image with the background...
    • OldGuyWalking
      Identifying Button in Toolbar When There is no ControID
      By OldGuyWalking
      I want to click on a button that is inside a custom ToolBar on a nonAutoIT created form.  I've been using MouseClick but that fails if the toolbar is detached or if the form is resized.
      There is no ID associated with the toolbar but there is a handle.  I'm thinking that to get the handle I need a ControlID but that only gets me to the toolbar and I'd then need to have a way to identify the position of a button in order to click on it.  
      I'd found a discussion about identifying the position of a noname button by, I believe, it's Tip text back in December but I can't find it now.  Memory is a bit fuzzy on how I even got to the topic because at the time I was searching for something else.   I'll continue to search but if anyone has seen the topic, or knows of another solution could you please point me in that direction. 
      Thank you.
    • rootx
      Best way to play little video inside a Gui
      By rootx
      I would like to insert a video player inside the gui Autoit, preferably one with a free license such as Media Player Classic or VLC, I saw in the forum but I found examples of many years ago.
      Some examples links or advice would be much help
    • passwd
      Two images in one GUI control with ability to move image
      By passwd
      Hello. I'm trying to make a form with two pictures and one button. But pictures must overlap one another. First picture I'm getting from screenshot of another window, but second picture must be with alfa channel and positioning on that first image.
      Something like that:
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <ScreenCapture.au3> Global Const $AC_SRC_ALPHA = 1 $Form1_1 = GUICreate("Document", 701, 671, -1, -1) GUISetBkColor(0xFFFFFF) $Pic1 = GUICtrlCreatePic("", 8, 8, 409, 657) $Button1 = GUICtrlCreateButton("Take Picture", 424, 8, 161, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Generate() EndSwitch WEnd Func Generate() Local $hBMP, $hBitmap, $hGraphic, $WindowToCapture WinActivate("Notepad") $WindowToCapture = ControlGetHandle("Notepad", "", "[CLASS:Edit; INSTANCE:1]") $hBMP = _ScreenCapture_CaptureWnd ( '', $WindowToCapture,4,4,400,470,False) ; Initialize GDI+ library _GDIPlus_Startup() $PicHandle = GUICtrlGetHandle($Pic1) $myGuiHandle = ControlGetHandle("Document", "", $PicHandle) $TransparentButtonTest = GUICreate("", 0, 0, 390, 130, $WS_EX_MDICHILD, $WS_EX_LAYERED, $myGuiHandle) $hImageButton = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\2-f.png") SetBitMap($TransparentButtonTest, $hImageButton, 255) GUISetState() WinActivate("Document") ; Draw bitmap to GUI $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) $hGraphic = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($Pic1)) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 100) ; Clean up resources _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_BitmapDispose($hBitmap) _WinAPI_DeleteObject($hBMP) ; Shut down GDI+ library _GDIPlus_Shutdown() EndFunc Func SetBitmap($hGUI, $hImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc ;==>SetBitmap But the most interesting, that I need to move second picture(png FromFile) by draging it with mouse ontop of first image.
      Can you tell me what I have done wrong and maybe there is some easier ways to do this?
    • Hasoth
      pop-ups using embeded Obj in GUI blocks script from working (onbeforeunload IE)
      By Hasoth
      Hi,
      I've encountered a problem while I tried to close popup in application that is using embeded GUI object. If site has function "onbeforeunload" asking if you really want to exit you will get a popup. In embeded gui object it completly freezes functions and I can't click/close/do anything. I've created sample code with microsoft function example and in external window. Any idea how to close popup in GUI embeded IE? I've tried navigating using _IENavigate($oIE, $sURL, 0) or  changing focus _IEaction($oIE,"focus") but nothing works.
      #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <IE.au3> HotKeySet("{F1}", "myExit") ;GUI setup $GUI_main = GUICreate("Menu", 800, 800, -1, -1) Global $oIE =_IECreateEmbedded() $ObjectIE = GUICtrlCreateObj($oIE, 0, 30, 800, 770) $cButton1 = GUICtrlCreateButton("Start test inside GUI window", 0, 0, 400, 30) $cButton2 = GUICtrlCreateButton("Start test outside GUI window", 400, 0, 400, 30) GUISetState(@SW_SHOW, $GUI_main) ;GUI While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_main Case $ObjectIE Case $cButton1 fTestFunction1() Case $cButton2 fTestFunction2() EndSwitch WEnd ;function inside GUI Func fTestFunction1() Local $sURL = "http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onbeforeunload.htm" $oIE.Navigate($sURL) _IELoadWait($oIE) $oIE.Navigate("https://www.google.com") MsgBox($MB_TOPMOST, "", "should appear while question box opened", 2) Sleep(2500) Send("!o") EndFunc ;function outside GUI Func fTestFunction2() Local $sURL = "http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onbeforeunload.htm" $oSecondIE = _IECreate ($sURL) _IELoadWait($oSecondIE) $oSecondIE.Navigate("https://www.google.com") MsgBox($MB_TOPMOST, "", "should appear while question box opened", 2) Sleep(2500) Send("!o") EndFunc ;shortcut to exit Func myExit() GUIDelete($GUI_main) Exit EndFunc