InternetExplorer.Application in private

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
apolonas
Posts: 43
Joined: 30 Apr 2014, 11:50

InternetExplorer.Application in private

06 May 2014, 15:01

Hello,
I want to make this code:

Code: Select all

wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := false
wb.navigate2("www.speedtest.net")
sleep,1000
while (wb.busy || wb.readystate != 4)
	sleep , 100
run in private mode.

I found this

http://visualbasic.a.../proc_html2.htm

whith a solution in VB.NET

Code: Select all

Web Pages Using VB.NET

In VB.NET, you can add a reference to ShDocVw.dll (in Windows/System32) using theBrowse tab in Add Reference) and open an instance of IE 8 using the new "InPrivate" mode.

Dim TheBrowser = New SHDocVw.InternetExplorerMedium
TheBrowser.Visible = True
TheBrowser.Navigate( _
URL:="http://visualbasic.about.com") 
But I cant convert this code to ahk . Any help would be appreciated!

Also I know a way to make it work by starting the IE in private mode.
Then find the pointer of IE and then hide the window .
The problem is that with this way the window shows up then find the pointer and then hide.
Hamlet
Posts: 32
Joined: 02 Oct 2013, 09:55
Location: Seoul, Korea

Re: InternetExplorer.Application in private

06 May 2014, 22:08

What is the "private mode" ?
If you want "Un-visible" mode, it is the default settings.
The first code works fine with me.
User avatar
Menixator
Posts: 69
Joined: 30 Sep 2013, 04:10

Re: InternetExplorer.Application in private

07 May 2014, 00:31

I don't know if this will work as expected.

Code: Select all

Run, Iexplore.exe -private,,,PID
WinWait, ahk_pid %PID%
Sleep,500 ;If the script doesn't work, you can try increasing this.
Pwb := IEGet(WinExist("ahk_pid " . PID))
MsgBox % Pwb.hwnd
Pwb.navigate("http://www.google.com")

IEGet(hwnd)		
{
	for window in ComObjCreate("Shell.Application").Windows{
		if (window.HWND == hwnd){
			return window
		}
	}
	return ""
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Askeron52, Beorn and 92 guests