How to open a webpage with InPrivate?

Get help with using AutoHotkey and its commands and hotkeys
Posts: 599
Joined: 06 Dec 2018, 04:36

How to open a webpage with InPrivate?

04 Oct 2019, 06:22


I tried the following, but an Error: 0x80010108 error occurred.

Code: Select all

ie := ComObjCreate("InternetExplorer.Application")
ie.Visible := true
WinWait, % "ahk_id " ie.hwnd
PostMessage, 0x111, 0x8, 0,, % "ahk_id " ie.hwnd
Posts: 4
Joined: 08 Oct 2019, 11:29

Re: How to open a webpage with InPrivate?

08 Oct 2019, 21:25

I don't know about the error you get, but I think there's no way to handle InPrivate windows from IE's objects. Here's a workaround that runs IE InPrivate mode and then uses ShellWindows to get the IE object.

Code: Select all

Run, iexplore.exe -private								; Run IE InPrivate mode

; Sleep 1000											; Wait for IE to finish loading

obj := ComObjCreate("Shell.Application").Windows		; Create a ShellWindows object to get the open windows

for window in obj {										; Look for IE's window
	if (window.Name = "Internet Explorer") {
		ie := window									; Get the InPrivate window

I had to use the Sleep command because WinWait wasn't working and sometimes ShellWindows coulnd't get the IE window.
User avatar
Posts: 1514
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: How to open a webpage with InPrivate?

08 Oct 2019, 22:24

This pretty much is exactly what knoxastic is doing, but in a more isolated manner. Unfortunately flashes the window though, I've never been able to get around that.

If you don't feel like dissecting it, here's an example to use the object.

Code: Select all

ie:=new IEObj
And of course, you can always access the COM obj directly with ie.wb.
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], blenderfish, boiler, DaveT1, Google [Bot], hackkk745, moszt, SmallGamer, sofista and 45 guests