COM interface with explorer issue

Get help with using AutoHotkey and its commands and hotkeys
Posts: 9
Joined: 26 Mar 2016, 10:23

COM interface with explorer issue

22 Apr 2016, 23:47

Ok so I have a window which I need to logout of.. When I do this however, I need to click() on a button which opens a new tab. The logout is on the bottom of this new tab window. Of course, ComOBJCreate() is attached to the first window. and I need to access the second. Are there any suggestions on how to get the Com object of the new window so that I can interact with that windows controls.
User avatar
Posts: 188
Joined: 30 Sep 2013, 19:52
Location: Iowa

Re: COM interface with explorer issue

24 Apr 2016, 14:09

Well, you could get it by window title or webpage name/url (see WBGet & IEGet here) ...

... or you could utilize the fact that that the new window should be the last item in the shell.application->windows collection. You could do this by getting the window count, clicking the link, waiting for the window count to increase, then grabbing the last window:

Code: Select all

windows := ComObjCreate("shell.application").windows()
count := windows.count

; Click Link Here

while (count = windows.count)
    sleep 100

wb := windows.item(windows.count - 1)

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, Chunjee, Clemens375, doubledave22, elbeau, Flipeador, slupka and 61 guests