Daavis Posted May 24, 2016 Posted May 24, 2016 Hi guys! I found some solution for embedded firefox so i tested it: #include <GUIConstants.au3> $oFF = ObjCreate("Mozilla.Browser") if Not Isobj($oFF) then Msgbox(0,"Mozilla","Can't get Mozilla") endif GUICreate ( "FF Embedded Web control Test", 1200, 800, Default, Default, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj ( $oFF, 0, 0 , 1200 , 800 ) GUISetState () ;Show GUI $oFF.navigate("https://www.google.com/") MsgBox(0,"","") It works fine but only if I tried run google.com. Other pages were blank. And there is some popup all the time. Another thing is how can i get html of curret page or click on element by id like in FF.au3
AutoBert Posted May 24, 2016 Posted May 24, 2016 It doesn't work: I suggest: try to get the handle of FireFox window $hWin = _FFWindowGetHandle() and make it to a child of your GUI. This short example: expandcollapse popup#include<GUIConstantsEx.au3> #include<WinAPI.au3> #include<WindowsConstants.au3> #include<Constants.au3> $hGUIMain = GUICreate("Parent") $Toolbar_hoehe = 30 $Toolbar_breite= 100 $hGUITool = GUICreate("Toolbar", $Toolbar_breite ,$Toolbar_hoehe,-1,-1,$WS_SYSMENU+$WS_CAPTION,$WS_EX_TOOLWINDOW) $Toolbarfenster = WinGetPos($hGUITool) GUISetBkColor(0xaabbcc) $btnToggle = GUICtrlCreateButton("TG",1,1,28,28) GUISetState(@SW_SHOW,$hGUIMain) GUISetState(@SW_SHOW,$hGUITool) While 1 $avMsg = GUIGetMsg(1) Switch $avMsg[1] Case $hGUIMain Switch $avMsg[0] Case -3 Exit EndSwitch Case $hGUITool Switch $avMsg[0] Case $btnToggle If _WinAPI_GetParent($hGUITool) <> $hGUIMain Then ContinueCase ; wenn es kein Child-Fenster ist, dann zu einem machen $pos = WinGetPos($hGUITool) ; alte Position speichern _WinAPI_SetParent($hGUITool,0) ; Parent entfernen WinMove($hGUITool,"",$pos[0],$pos[1],$Toolbarfenster[2],$Toolbarfenster[3]) ; an alte Position schieben GUISetStyle($WS_SYSMENU+$WS_CAPTION,$WS_EX_TOOLWINDOW,$hGUITool) ; neuer Style Case -3 GUISetStyle(BitOR($WS_CHILD,$WS_BORDER),0,$hGUITool) ; den Style ändern _WinAPI_SetParent($hGUITool, $hGUIMain) ; einbetten WinMove($hGUITool,"",0,0,$Toolbar_breite,$Toolbar_hoehe) ; an 0,0 des Hauptfensters schieben _WinAPI_RedrawWindow($hGUITool) ; neu zeichenen _WinAPI_RedrawWindow($hGUIMain) ; neu zeichenen EndSwitch EndSwitch WEnd should help to explore the needed functions. Daavis 1
Daavis Posted May 24, 2016 Author Posted May 24, 2016 Great idea! It works fine but there is a title and some other windows stuff. #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Constants.au3> $hGUIMain = GUICreate("Parent", 800, 600) GUISetState(@SW_SHOW, $hGUIMain) Opt("WinTitleMatchMode", 2) $hGUITool = WinGetHandle("Firefox") If $hGUITool = 0 Then MsgBox(0,"","Run firefox first!") Exit EndIf $Toolbarfenster = WinGetPos($hGUITool) GUISetStyle(BitOR($WS_CHILD, $WS_BORDER), 0, $hGUITool) ; den Style ändern _WinAPI_SetParent($hGUITool, $hGUIMain) ; einbetten WinMove($hGUITool, "", 0, 0, 800, 600) ; an 0,0 des Hauptfensters schieben _WinAPI_RedrawWindow($hGUITool) ; neu zeichenen _WinAPI_RedrawWindow($hGUIMain) ; neu zeichenen While 1 $avMsg = GUIGetMsg(1) Switch $avMsg[1] Case $hGUIMain Switch $avMsg[0] Case -3 Exit EndSwitch EndSwitch WEnd
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now