IE Visible Without Active With COM

Get help with using AutoHotkey and its commands and hotkeys
kkleinfelter
Posts: 21
Joined: 21 Dec 2018, 10:59

IE Visible Without Active With COM

Post by kkleinfelter » 29 Aug 2019, 12:17

When I execute the following code, IE is launched, made visible, and the IE window is ACTIVATED. Is there a way to make it visible without activating it?

Code: Select all

    wb := ComObjCreate("InternetExplorer.Application")
    wb.visible := true

Yuck! It looks like this activates IE too. Is it possible to automate IE without activating it all the time?

Code: Select all

  wb.Navigate(URL)

Vaklev
Posts: 47
Joined: 04 Mar 2019, 13:58

Re: IE Visible Without Active With COM

Post by Vaklev » 29 Aug 2019, 14:38

AHK does not have an unactivate window command, your best bet if you don't want it popping up is to throw in a winactivate command for a diff window you want active, or:

https://www.autohotkey.com/docs/commands/WinMinimize.htm

teadrinker
Posts: 1900
Joined: 29 Mar 2015, 09:41
Contact:

Re: IE Visible Without Active With COM

Post by teadrinker » 29 Aug 2019, 14:55

Try this:

Code: Select all

DetectHiddenWindows, On
wb := ComObjCreate("InternetExplorer.Application")
WinWait, % "ahk_id" wb.hwnd
DllCall("ShowWindow", "Ptr", wb.hwnd, "UInt", SW_SHOWNA := 8)

wb.Navigate("https://www.autohotkey.com/boards/viewforum.php?f=76")
while wb.Busy
   Sleep, 100
Sleep, 1000
wb.Navigate("https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67545")

Post Reply

Return to “Ask For Help”