How to get out of Full Screen mode in IE ...

123

Senior Member
Problem: Touchscreen, with no keyboard or mouse, is showing Internet Explorer in FullScreen mode. How do you get out of FullScreen mode?
  • If you have a keyboard you can press F11 and toggle out of FullScreen mode.
  • If you have a mouse you can touch the top edge of the display (i.e. 1st line of pixels) and IE's menu bar will scroll down and allow you to click Tools > Full Screen. Unfortunately, my Touchscreen lets your finger get within 5 pixels of the top edge but no closer ... so you can't activate IE's hidden menu.
  • You can try to do something with Javascript but that won't get you far because of IE's security restrictions.
  • You can write some VBScript code that finds the appropriate IE session (by its URL) and then sets the FullScreen property to false. Problem is that my HA app refuses to "CreateObject("Shell.Application").Windows". Why not? No clue; something about "ActiveX object can't do that".
Code:
Dim oItems, oItem
Set oItems = CreateObject("Shell.Application").Windows
If oItems.Count > 0 Then
	For Each oItem In oItems
		If InStr(oItem.LocationURL, "/sys/") > 0 Then oItem.FullScreen = false
	Next
End if
Set oItems = Nothing
Set oItem = Nothing

Anyone have any creative ideas to resolve this seemingly simple problem?

PS
I'd settle for a means of making the Windows Start menu appear ... Ctrl-Esc if you had a keyboard!
 
Do you have access to the file system? If so, you could create a little AutoIT script (and compile into an exe), simulating the F11 key (you can even send it to a window). Putting it in the startup folder would fix this issue. If you only have access through the browser, then you would have to 'save' the exe to the correct directory.
 
That's a good suggestion and I thought of re-working it slightly by attempting to execute an external VBS script (i.e. the one above) as opposed to a compiled AutoIT program.

The hurdle I've encountered is that I can't call external applications ... and that's weird because it should work! Premise used to have a "system.CreateProcess" command, to execute external apps, but it was trounced by Win XP SP2's increased security. The workaround was to use CreateObject("WScript.Shell") and simply Exec the external app.

I'm using Win XP SP3 and this simple code does not work for me (when executed from within Premise):
Code:
set oItem = CreateObject("WScript.Shell")
oItem.Exec("c:\windows\system32\calc.exe")

Yet another security restriction with SP3??? OK, let's forget about Premise's headaches ... any other ideas?
 
Does you monitor allow you to shift the image down?, most do. Or is this a UMPC or something?
 
Yes, but not easily; it is a wall-mounted ELO ET1545. There are no setup buttons (nor power) anywhere on the front of the unit.

It is calibrated and works well but you can't touch the first pixel-line ... the closest I can get is about 5 pixels to the top edge. Normally this is hardly a problem ... and then there's IE7's hidden menu.
 
So you are trying to design a button that exits full screen mode? I guess I misunderstood.

EventGhost supports triggering events based on certain HTTP requests. So you should be able to automate the F11 key by loading a certain URL.
 

That file looked very promising unfortunately none of the suggestions worked (except for F11). IE7 won't allow a Javascript 'fullscreen=1' command to run without carping ... same for 'fullscreen=0'. Some examples referred to a property called Theatermode and that's no longer an IE7 property (changing it to Fullscreen didn't help). Another example used Javascript functions called FullScreen() and Restore() but they do not work if IE7 is already in FullScreen mode.

I suspect there's no way to do this using Javascript.
 
So you are trying to design a button that exits full screen mode? I guess I misunderstood.
...

Nope, you didn't misunderstand the problem ... I'm looking for anything that will get IE7 out of Full Screen mode via scripting. A JavaScript function was one possibility but it doesn't work with IE7. The VBS code I posted works except I can't call it from Premise for some silly reason. Maybe I can embed the code in the web-page itself and call it that way. Or I can explore using EventGhost ... I'll try 'em all to get outta fullscreen h*ll.


ADDENDUM
Whew! The solution is simple but finding it wasn't!

I believe "Shell.Application" and "Wscript.Shell" are considered to be evil ActiveX objects by IE because they can interact with the desktop ... not something you want the average web page to do on your PC. However, you need this ability to get out of IE's fullscreen mode using script.

In IE7, go to Tools > Internet Options > Security > Local Intranet > Custom Level and set "Initialize and script ActiveX controls not marked as safe for scripting" from Disable to Enable. Never do this for the Internet zone!

Somewhere in your web page, add a link that triggers the following function:
Code:
<script language="VBScript" type="text/vbscript">
function ShowDesktop()
		set objShell = CreateObject("Shell.Application")
		objShell.ToggleDesktop
		set objShell = nothing
end function
</SCRIPT>


"ToggleDesktop" will minimize all open applications, including fullscreen IE, and expose the Windows Desktop. The "Shell.Application" object offers other methods that can be used to get IE out of Full Screen mode (like in the 1st script I posted) but "ToggleDesktop" gives me exactly what I wanted.
 
Can you lower the browser security to allow the java app to run?

Brian

whoops, you posted right after I amended my earlier post.

Yup, lowering the security for the Intranet zone was what I had to do to get the job done using VBScript and the Shell.Application object.
 
Somewhere in your web page, add a link that triggers the following function:
Code:
<script language="VBScript" type="text/vbscript">
function ShowDesktop()
		set objShell = CreateObject("Shell.Application")
		objShell.ToggleDesktop
		set objShell = nothing
end function
</SCRIPT>

I've been trying to do the same thing for some time now, just have a button that would take my screen and toggle it between full screen and normal. This looks like what I've been trying to do! So my question is, what would that link look like to trigger this function? I simply want a button that when clicked takes the webpage to full screen and just the opposite, when in full screen the button will bring it out of it.

Thanks!
 
if you want to do this remeotely then possibly you could use wscript for the command and psexec to run it remotely
 
... a button that would take my screen and toggle it between full screen and normal. ...
Your web page needs to use the HTML "onclick" event to call a script that'll toggle the display mode. Onclick can be used with various tags like button, img, div, etc. The supplied example uses it with a div and some CSS.

The attached file is a web page containing a single button that, when clicked, will toggle IE between normal and full screen modes. I've tested it and it works with IE7.

To run it, you must make the security change documented in the previous post:
In IE7, go to Tools > Internet Options > Security > Local Intranet > Custom Level and set "Initialize and script ActiveX controls not marked as safe for scripting" from Disable to Enable.

You must make the following change as well:
In IE7, go to Tools > Internet Options > Security > Local Intranet > Sites > Advanced and add the following site: http://localhost

IE prevents local web pages from executing certain ActiveX objects, like Shell.Application. By adjusting IE's Security settings and ensuring the web page contains an appropriate Mark Of The Web, the page will be allowed to run.

The example's onclick event calls the ToggleMode() function. If you change it to ShowDesktop(), the browser and all other open apps, will be minimized.
 

Attachments

123,
Thank you very much for the examples. They work great.

One note though, when I click the button it goes into full screen mode, works perfect. But when I click it again it comes out of full screen mode minus a bar.

before going to full screen:
ie-example-before.jpg


then I go to full screen, all is great!

but then when I exit full screen it looks like this:
ie-example-after.jpg


This is using IE7.

Any ideas on how to get it to be the same before and after, toolbars and all?
 
Back
Top