Is it somehow possible to connect multiple AutoHotkey objects to a single COM object? When I try the below code, only the method of the second connected object is called. Besides, the message box is shown twice per event which I think is not normal.
Code: Select all
#NoEnv
#SingleInstance, Force
SendMode, Input
SetWorkingDir, %A_ScriptDir%
Gui, Add, ActiveX, w1280 h720 vWB, Shell.Explorer
Gui, Show
ComObjConnect( WB, new WB_Events1() )
ComObjConnect( WB, new WB_Events2() )
sURL := "http://www.google.com"
WB.Silent := True
WB.Navigate( sURL )
Return
class WB_Events1 {
TitleChange(title) {
msgbox % "first: " A_ThisFunc
}
}
class WB_Events2 {
TitleChange(title) {
msgbox % "second: " A_ThisFunc
}
}
GuiClose:
ExitApp