WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Remove Title Bar from IE


Question:

Does anyone know of a way to remove the title bar from a window ? (including all the max/minimise/close options that go along with it ?) Im trying to do this with IE6. I found examples in the database that disable the min/max/close, but dont totally remove the title bar. All versions of IE can be run in "Kiosk" mode, where there is no title bar at all. So Im assuming there must be some windows function that can do this.

Answer:

;   for IE6 use the .fullscreen property, via OLE...

#definesubroutine startMSIE()
   Browser = objectopen("InternetExplorer.Application")
;   Browser.addressbar = @false
;   Browser.statusbar = @false
;   Browser.menubar = @false
;   Browser.toolbar = @false
   Browser.fullscreen = @true   ;<-- no bars
   browser.visible = @true
   browser.offline = @true     ;<-- offline setting...

   url = "C:\test.html"        ;<-- URL doesn't matter...

   browser.navigate(url)
   ;WaitForPageLoad()
   ;   setup the document object...
   browserDoc = Browser.Document
   all = browserdoc.all
   return(browser)
#endsubroutine

#DefineSubroutine WaitForPageLoad()  ; assume Browser
   While browser.busy || browser.readystate == 1
      TimeDelay(0.5)
   EndWhile
   While browser.Document.ReadyState != "complete"
      TimeDelay(0.5)
   EndWhile
   return
#EndSubroutine



br = startMSIE()

timedelay(5)
br.quit

exit

User Reply:

Actually your reply is very close to what Im currently doing, except that I want the basic navigation buttons displayed. (Back/Forward/Home/Stop/Refresh) With OLE if you specify fullscreen you dont get the buttons. So I can either have the buttons, with the title bar, or no title bar and no buttons. Looking at the examples in the Database there are some close examples, but none that I can see that totally remove the title bar.

Answer:

;   BTW -- you know if you Right-click on IE6 Page you get the
;   Back, Forward and Refresh options?

;   for IE6 use the .TheaterMode property, via OLE...

;   mix and match with the other bars...

#definesubroutine startMSIE()
   Browser = objectopen("InternetExplorer.Application")
   Browser.addressbar = @true
   Browser.statusbar = @true
;   Browser.menubar = @false
   Browser.toolbar = @true
   Browser.TheaterMode = @true   ;<-- TheaterMode
   browser.visible = @true
   browser.offline = @true     ;<-- offline setting...

   url = "C:\test.html"        ;<-- URL doesn't matter...

   browser.navigate(url)
   ;WaitForpageLoad()
   ;   setup the document object...
   browserDoc = Browser.Document
   all = browserdoc.all
   return(browser)
#endsubroutine

#DefineSubroutine WaitForPageLoad()  ; assume Browser
   While browser.busy || browser.readystate == 1
      TimeDelay(0.5)
   EndWhile
   While browser.Document.ReadyState != "complete"
      TimeDelay(0.5)
   EndWhile
   return
#EndSubroutine


br = startMSIE()

timedelay(5)

br.quit

exit


OR


;Here's a UDF from Guido that should give you what you're looking for:

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
;FixBox : Sets window style.                                                      ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
;Win   : window name                                                              ;
;flags : Use '&' to combine flags                                                 ;
;        ~262144    unresizable                                                   ;
;        ~65536     remove maximize                                               ;
;        ~131072    remove minimize                                               ;
;        ~12582912  remove caption                                                ;
;        ~524288    remove system menu                                            ;
;        2147483648 pop up mode                                                   ;
;        8388608    pop up mode with border                                       ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
#DefineFunction FixBox(Win,Flags)                          ;Originally by Guido, with some liberties taken by Marc Worrel
hwnd=DllHwnd (Win)                                         ;Get window handle
User32 = StrCat(DirWindows(1),"USER32.DLL")
OldStyle=DllCall(User32, long:"GetWindowLongA",long:hwnd,long:-16)
NewStyle=OldStyle & Flags
Result = DllCall(User32,long:"SetWindowLongA",long:hwnd,long:-16,long:NewStyle)
Return (Result)
#EndFunction

Run ("Iexplore.exe","")
FixBox ("~Microsoft Internet Explorer",~12582912)

Exit

;A non-UDF version:
Run ("Iexplore.exe","")
hwnd=DllHwnd("~Microsoft Internet Explorer") 
OldStyle=DllCall(StrCat(DirWindows(1),"User32.dll"),long:"GetWindowLongA",long:hwnd,long:-16)
NewStyle=OldStyle & ~12582912
Result = DllCall(StrCat(DirWindows(1),"User32.dll"),long:"SetWindowLongA",long:hwnd,long:-16,long:NewStyle)
Exit



Article ID:   W16132
File Created: 2004:08:02:11:14:42
Last Updated: 2004:08:02:11:14:42