Create IE window without title bar and border line

Get help with using AutoHotkey and its commands and hotkeys
DanielToward13
Posts: 74
Joined: 18 May 2017, 10:56

Create IE window without title bar and border line

09 Dec 2017, 22:51

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?
User avatar
boiler
Posts: 6171
Joined: 21 Dec 2014, 02:44

Re: Create IE window without title bar and border line

09 Dec 2017, 23:46

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
DanielToward13
Posts: 74
Joined: 18 May 2017, 10:56

Re: Create IE window without title bar and border line

10 Dec 2017, 08:46

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?
User avatar
boiler
Posts: 6171
Joined: 21 Dec 2014, 02:44

Re: Create IE window without title bar and border line

10 Dec 2017, 09:00

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.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Create IE window without title bar and border line

10 Dec 2017, 09:25

- 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
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKNoobie, Bing [Bot], boiler, Google [Bot], hasantr, mikeyww, roonyroox, RubbeH, songdg, vomitsurfer and 49 guests