There are certain elements that you can't type in, or rather, you can only
sometimes (inconsistently) type in when using an IE object embedded into an AHK GUI. This has plagued me for a very, very long time, and I very likely asked this on the old forums as well, though I never got an answer. The following code will show the issue (please put in a channel name, I don't want to inadvertently promote any channels) using the Twitch Chat popout page (try typing into the chat box). If you type in the Google page, then try again on the Twitch page, you'll notice it's still typing in Google, as if the element is not active. I suppose I could have it to when the Twitch IE object is clicked to force it active, but I'm not quite sure how to go about doing so..
Code: Select all
#singleInstance force
#persistent
detectHiddenWindows on
channel:=""
onExit,guiClose
wb_twitch:=comObjCreate("InternetExplorer.Application")
wb_google:=comObjCreate("InternetExplorer.Application")
wb_twitch.navigate("https://twitch.tv/" . channel . "/chat?popout=")
wb_google.navigate("google.com")
wb_twitch.fullscreen:=1
wb_google.fullscreen:=1
winMove,% "ahk_id " . wb_twitch.hwnd,,0,0,399,600
winMove,% "ahk_id " . wb_google.hwnd,,400,0,400,600
gui,+hwndghwnd
setParentByHwnd(wb_twitch.hwnd,ghwnd)
setParentByHwnd(wb_google.hwnd,ghwnd)
wb_twitch.visible:=1
wb_google.visible:=1
gui,show,w800 h600,IE Test
return
guiClose:
try{
wb_twitch.quit()
wb_google.quit()
}
sleep 5000
exitApp
setParentByHwnd(child,parent){
dllCall("SetParent","ptr",child,"ptr",parent)
winSet,style,+0x40000000,% "ahk_id " . child
}
I've had numerous other people test and report back the same typing issue, though I'm unaware of their OSes. It can be "fixed" if you create a sysmenu and click around in it (not sure if it's just anywhere or specifically submenus), then click back to the IE object.
Hopefully that's enough info for someone to come up with an idea