Page 1 of 1

Create IE window without title bar and border line

Posted: 09 Dec 2017, 22:51
by DanielToward13
is there a way to hide title bar and border line of the Internet Explorer window like what we do for wb.ToolBar := false and wb.MenuBar := false?

Re: Create IE window without title bar and border line

Posted: 09 Dec 2017, 23:46
by boiler
Not sure if this is the look you're going for:

Code: Select all

Run, iexplore.exe
WinWait, ahk_exe iexplore.exe
WinSet, Style, -0xC00000, ahk_exe iexplore.exe ;remove caption
WinSet, Style, -0x40000, ahk_exe iexplore.exe ;remove border

Re: Create IE window without title bar and border line

Posted: 10 Dec 2017, 00:03
by BoBo
Run, iexplore -k "html://www.autohotkey.com"

Re: Create IE window without title bar and border line

Posted: 10 Dec 2017, 08:46
by DanielToward13
I am looking for something like the below code:

Code: Select all

    Path := "http://www.autohotkey.com"
    wb := ComObjCreate("InternetExplorer.Application")
    wb.visible := true
    wb.ToolBar := false
    wb.MenuBar := false
    wb.Height := 1400
	wb.Width := 1400
    wb.Navigate(Path)
	WinSet, Style, -0xC00000, A
	WinSet, Style, -0x40000, A
	
    While wb.readyState!=4 || wb.document.readyState!="complete" || wb.busy
		Sleep 50
The problem with this code is that sometimes WinSet will change other active windows. I tried this but it doesn't work.

Code: Select all

Path := "http://www.autohotkey.com"
    wb := ComObjCreate("InternetExplorer.Application")
    wb.visible := true
    wb.ToolBar := false
    wb.MenuBar := false
    wb.Height := 1400
	wb.Width := 1400
    wb.Navigate(Path)
	oIEHWND := wb.HWND
	WinSet, Style, -0xC00000, ahk_id %oIEHWND%
	WinSet, Style, -0x40000, ahk_id %oIEHWND%
	
    While wb.readyState!=4 || wb.document.readyState!="complete" || wb.busy
		Sleep 50

How can I do it using wb.HWND to make sure that only the created IE object by AutoHotKey is selected? or is there a better way to do it?

Re: Create IE window without title bar and border line

Posted: 10 Dec 2017, 09:00
by boiler
You tried exactly what I would have suggested. A compromise between using A for the active window and wb.HWND might be to define the WinTitle as I did (ahk_exe iexplore.exe). If you have only one IE window, it would seem to work.

Re: Create IE window without title bar and border line

Posted: 10 Dec 2017, 09:25
by jeeswg
- Your script worked for me, I've made two edits that I've marked, that might make it slightly more reliable, but that perhaps aren't necessary.

Code: Select all

DetectHiddenWindows, On ;edit (in case we grab the hWnd before the window is visible)
Path := "http://www.autohotkey.com"
    wb := ComObjCreate("InternetExplorer.Application")
    wb.visible := true
    wb.ToolBar := false
    wb.MenuBar := false
    wb.Height := 1400
	wb.Width := 1400
    wb.Navigate(Path)
	oIEHWND := wb.HWND
	if oIEHWND ;edit (I don't really think this is necessary, because I would expect to have an hWnd here)
	{
		WinSet, Style, -0xC00000, ahk_id %oIEHWND%
		WinSet, Style, -0x40000, ahk_id %oIEHWND%
	}

    While wb.readyState!=4 || wb.document.readyState!="complete" || wb.busy
		Sleep 50
- Re. a compromise, I would use: ahk_class IEFrame