Sign in to follow this  
Followers 0
UEZ

Blank white page rendered only in embedded IE control

27 posts in this topic

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



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

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

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

    • rm4453
      Custom Stream GUI Using Autoit Gui Wrap
      By rm4453
      Hey guys! I need to find a way to wrap an autoit gui around a game. I am planning on making a custom gui overlay for interacting with my stream, which will allow me to run giveaways and stuff like that. But I need to find a way to force the steam games to run inside my autoit gui... I have the following code so far credit to those I took code from and modified to suite my needs "can't remember who u are pls post if i owe ty to u" If I select notepad and launch it then it works great! and the notepad window is wrapped inside my gui. However if I try it with teamfortress 2 it won't work...
       
      #include <Array.au3> #include <File.au3> #include <WinAPI.au3> #include <GUIConstants.au3> Local $msg, $hwnd, $WinHwnd ;===> UDV Start $pid = 0 $Hidden = 0 $exe = 0 $sDrive = 0 $sDir = 0 $sFileName = 0 $sExtension = 0 ;===> UDV End $hwnd = GUICreate("hello") $Open = GUICtrlCreateButton("Launch Game", 10, 30, 75, 25) $Select = GUICtrlCreateButton("Select Game", 10,60,75,25) GUISetState() ;===> UDF START Func _GetWinHwnd($pid) $aWinlist = WinList() For $i = 1 To $aWinlist[0][0] If $pid = WinGetProcess($aWinlist[$i][0]) Then Return $aWinlist[$i][0] Next EndFunc ;==>_GetWinHwnd Func _SetParentWindow($pid) $WinInfo = _GetWinHwnd($pid) $WinHwnd = ControlGetHandle($WinInfo, "", "") _WinAPI_SetParent($WinHwnd, $hwnd) _WinAPI_SetWindowLong($WinHwnd, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) WinMove($WinHwnd, "", 0, 0) EndFunc ;==>_SetParentWindow Func RedrawGui($RedrawMe) If ProcessExists($pid) And $Hidden = 0 Then GUICtrlSetState($RedrawMe, @SW_HIDE) $Hidden = 1 sleep(50) _WinAPI_RedrawWindow($pid) Sleep(50) ElseIf $Hidden = 1 And Not ProcessExists($pid) Then GUICtrlSetState($RedrawMe, @SW_SHOW) $Hidden = 0 EndIf EndFunc ;===> UDF END While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE If ProcessExists($pid) Then ProcessClose($pid) GUICtrlSetState($Open, @SW_SHOW) Else Exit EndIf Case $Open GUICtrlSetState($Open, @SW_HIDE) Sleep(100) $pid = Run('"' & $exe & '" -game tf -steam') #cs This RUN CMD is custom made for testing with TF2 change to just $exe to select any exe you want to test with -game tf specifies to launch tf2 and -steam gets rid of insecure mode error #ce RedrawGui($Open) ProcessWait($pid) Sleep(5500) _GetWinHwnd($pid) _SetParentWindow($pid) Case $Select $exe = FileOpenDialog("Please select your game!", @ScriptDir, "Executable File (*.exe)", "1", "Process Selection") Sleep(50) FileChangeDir(@ScriptDir) _PathSplit($exe, $sDrive, $sDir, $sFileName, $sExtension) EndSwitch WEnd  
    • FrankSchneidewind
      [GUI] Drag&Drop files -> Get filename
      By FrankSchneidewind
      Hi all,
      I got a quick question regarding Drag&Drop with GUIs. I made a little script that does something with files and I need a way to get the name/path of the file when I drag&drop it into the GUI. Is there a quick way to do this?

      Tyvm in advance!
      Neo
    • Wingens
      Metro style combo
      By Wingens
      Hi all,
      I created a little script we use at work for inputing date and time stamps into our ticket system.
      Now I thought it would look nice in a Metro style GUI, I found an UDF on the forum what does almost everything I want.
      I have but one thing I can't seem to find and don't have the skills to create.
      The gui uses one pulldown menu (GUICtrlCreateCombo) it stays in the older looking style.
      I attached the script and files I have, also in the zip you find an example of what I am looking for.
       
      Hope you guys can help me 
      Hotkey.zip
    • jaberwacky
      GuiBuilderNxt - Reboot [08/18/2016]
      By jaberwacky
      This is an update to GuiBuilder (CyberSlug, Roy, TheSaint, and many others) to run on the latest AutoIt Beta release.
       
      For a chronological history of GuiBuilder and other GUI designers see: >AutoIt GUI Creators (Designers).
      The seed of this effort is >here.
      Note: This is early stage software.  Please help by reporting issues.
      -----------------------------------------------------
      Now for the latest exciting installment!  Tabs are now available!  One tab can be added to the GUI.  Move it, resize it, and right click to add a new tab item!  More context menu items on the way.  Also upcoming is the ability to be able to add controls to each tab item.
      ---------------------------------------------------------
      GUIBuilderNxt - Reboot.zip - Exe included.
      dl: 4286
      Changelog:
      New Features and fixes:
      1) Show or hide control while moving or resizing control. *Currently bugged out*
      2) Option to show controls which have had their state set to hidden.
      3) Properties window for each control as they are selected.  This makes fine tuning a control easier.
      4) A button which will resize a control's width to fit the text.  Uses Melba23's _StringSize library.
      5) Remembers settings from the last session.
      6) GuiOnEvent mode.  CyberSlug made mention of wanting to do this in the early days of GuiBuilder.
      7) Maps rather than multidimensional arrays.
      8) Consistent control naming, (i.e., instead of Group1, Button2, Button3, Radio4 it would now be Group1, Button1, Button2, Radio1).
      9) Restructured the menubar layout per GuiBuilder Resurrected.
      10) Hotkeys switched to accelerators.
      11) Option to wipe the gui clear to the Edit menu.
      12) Select and move multiple controls at once by holding down Ctrl or using a selection rectangle.
      13) Copy, Paste and Delete multiple controls at once.
      14) Solid grid background that now resizes to fit the GUI.
       
      Roadmap:
      1) Get the Tab control to work correctly. *Still in progress*
      2) Finish adding properties settings to the control properties window.
      3) Make the code generation produce code with a better layout.
      4) Common GUI templates.  Ability to make your own templates too.
      5) Select multiple controls and use arrow keys (or other method?) to snap the selected controls to align to the chosen edge.
      6) Visual hints to tell you when you're within so many pixels from the edge of the window or control.  Mimics the gui designer of Visual Basic.
      7) Double click a control to edit the text.
      8) Visual hints to indicate selected controls, etc.
      9) Ability to create and store custom controls.
       
      Known issues:
      1)Many!
    • FMS
      Winmove GUI moves buttons
      By FMS
      Hello,
      Below is a code whish i made for this problem i've. (code 1)
      The problem is that iff i try Winmove to to show the hidden button it's not working as i tought.
      What i try to do is just simple expand the GUI to make the hidden button visible. (code 2)
      I've already looked into GUICoordMode but don't think that's the problem.(or I don't understand it properly)
      Also tried to look into the forum but din't find anything around this subject but could't find anything around this subject.
      Does somebody knows what I'm doing wrong?
       
      Code 1 (winmove prblem) :
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 134, 103, 192, 124) $Button1 = GUICtrlCreateButton("1", 8, 8, 75, 25) $Button2 = GUICtrlCreateButton("2", 8, 40, 75, 25) $Button3 = GUICtrlCreateButton("3", 8, 72, 75, 25) $expand_button = GUICtrlCreateButton("EXP", 96, 40, 27, 25) $hidden_button = GUICtrlCreateButton("Hidden", 160, 40, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $expand_button WinMove($Form1, "From1", 192, 124, 300, 103) EndSwitch WEnd  
      Code 2 What I'm trying to expand to :
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 265, 114, 192, 124) $Button1 = GUICtrlCreateButton("1", 8, 8, 75, 25) $Button2 = GUICtrlCreateButton("2", 8, 40, 75, 25) $Button3 = GUICtrlCreateButton("3", 8, 72, 75, 25) $expand_button = GUICtrlCreateButton("EXP", 96, 40, 27, 25) $hidden_button = GUICtrlCreateButton("Hidden", 160, 40, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd