在 AutoIt 中使用 Firefox 创建 ObjCreate

ObjCreate with Firefox in AutoIt

我通过创建 IE 对象打开了分辨率为 360x640 的 IE。这是我的代码:

$object = ObjCreate("InternetExplorer.Application.1")
With $object
.Visible = 1
.Height = 640
.Width = 360
.Navigate("https://www.google.com.bd/?gws_rd=cr,ssl&ei=jm11Vb7_Iofg8AX0_IGYBw#q=ripon+al+wasim")
EndWith

我想在 AutoIt 中以同样的方式创建 Firefox 对象。我该怎么做?

首先您需要下载Mozilla ActiveX control.

Example usage code:

#include <GUIConstants.au3>

$oFF = ObjCreate("Mozilla.Browser.1")

; Create a simple GUI for our output

GUICreate ( "FF Embedded Web control Test", 640, 580,(@DesktopWidth-640)/2, (@DesktopHeight-580)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$GUIActiveX = GUICtrlCreateObj ( $oFF, 10, 40 , 600 , 360 )

$GUI_Button_Back = GuiCtrlCreateButton ("Back", 10, 420, 100, 30)

$GUI_Button_Forward = GuiCtrlCreateButton ("Forward", 120, 420, 100, 30)

$GUI_Button_Home = GuiCtrlCreateButton ("Home", 230, 420, 100, 30)

$GUI_Button_Stop = GuiCtrlCreateButton ("Stop", 330, 420, 100, 30)

GUISetState () ;Show GUI

$oFF.navigate("http://www.autoitscript.com")

; Waiting for user to close the window

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE
...