Gui,Add,ActiveX
提供: AutoHotkey Wiki
実行制御 | GUI表示 | 演算・変数 | メモリ・DLL操作 | 文字列操作 |
キーボード | マウス | シェル | ウィンドウ | ウィンドウグループ
ステータスバー | コントロール | サウンド | ファイル | INIファイル |
レジストリ | 環境変数 | AutoHotkey | その他 | 設定関係 | オブジェクト
Gui,Add,ActiveX [v1.1.03+][編集]
GUIウィンドウにInternet Explorer WebBrowserコントロールなどのActiveXコントロールを埋め込む。
Gui, Add, ActiveX [, Options, Component]
Parameters[編集]
引数名 | 説明 |
---|---|
Options | オプションを半角スペース区切りで列挙。 Gui,Addの項参照。 Vで変数名を指定すると、ActiveXオブジェクトが格納される。 |
Component | ActiveXコンポーネントの名前。 |
Remarks[編集]
ActiveX components such as the MSIE browser control can be embedded into a GUI window by following this example:
Gui Add, ActiveX, w980 h640 vWB, Shell.Explorer; The final parameter is the name of the ActiveX component.
WB.Navigate("http://www.autohotkey.com/forum/"); This is specific to the web browser control.
Gui Show
When the control is created, an ActiveX object is stored in the control's associated variable, if it has one. GuiControlGet can also be used to retrieve the object.
To handle events exposed by the object, use ComObjConnect as demonstrated below:
Gui Add, Edit, w930 r1 vURL, http://www.autohotkey.com/forum/ Gui Add, Button, x+6 yp w44 Default, Go Gui Add, ActiveX, xm w980 h640 vWB, Shell.Explorer ComObjConnect(WB, WB_events); Connect WB's events to the WB_events class object.
Gui Show; Continue on to load the initial page:
ButtonGo: Gui Submit, NoHide WB.Navigate(URL) Return class WB_events { NavigateComplete2(wb, NewURL) { GuiControl,, URL, %NewURL%; Update the URL edit control.
} } GuiClose: ExitApp
ComObjType can be used to determine the type of object stored in the control's variable.