...

View Full Version : current window resized to full screen?



supernuke
03-14-2005, 09:30 AM
hi

just tried a bunch of codes to get the current window resized to completely FULL screen onload, but none worked, any suggestions please?

thanks in advance.

P.S. the only one which seemed to work was this one and it appears to be malicious:

<script type="text/javascript">
function max()
{
var obj = new ActiveXObject("Wscript.shell");
obj.SendKeys("{F11}");
}
</script>
</head>
<body onload="javascript:max()">

ronaldb66
03-14-2005, 10:31 AM
You can probably get an answer faster on the javascript forum; if you do a bit of searching, I'm pretty sure you'll find that it has been answered already a number of times.
Apart from that, you need to realize that it's up to the visitor to decide what window size he/she wants to use; meddling with the user's browser is not really appreciated.

supernuke
03-14-2005, 06:02 PM
i did search the forum but i didnt found anything helpful, i read a window cant self resize to full screen, is that true?

_Aerospace_Eng_
03-14-2005, 09:24 PM
it can go fullscreen but only if it was opened in javascript in the first place, you could try a splash page, that had a link that opened a fullscreen window, or having an onload window open of a fullscreen window then closing the previous but even then that isn't a good idea since u would be messing with the users browser, and plus any automatic popup will more than likely be blocked by a popup blocker

supernuke
03-15-2005, 03:30 AM
thanks for your reply, but i didnt really understand, you mean i have to open the window to be self resized with javascript? actually im not using javascript there because when used, in case you are protecting from hotlinking, then the page you open with javascript cant be seen because the protection gets confused and understands you are linking the file from other site than the allowed ones so it show you an error page, thats why i want to resize in the same window that is open and not from the page which has the link to launch that window.

what about this code?

<script type="text/javascript">
function max()
{
var obj = new ActiveXObject("Wscript.shell");
obj.SendKeys("{F11}");
}
</script>
</head>
<body onload="javascript:max()">

_Aerospace_Eng_
03-15-2005, 03:39 AM
it works but its malicious as you already discovered partly because of the activex control that is being called, firewalls and antivirus will go off like crazy when it finds out what the script is trying to do, and an OS with SP2 will catch it like a frog catching a fly, you say it would be hotlinking from splash page, if you linking to a page on the same server as the splash page, then its not hotlinking, that is however you are linking to a paper that isn't urs, and like i said javascript full screen only

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Window Open</title>
<script type="text/javascript"><!--
function openwin(){
sw=screen.width;
sh=screen.height;
//window.open('http://www.yahoo.com','','fullscreen=yes'); //fullscreen=yes only works in IE
// window.open('http://www.yahoo.com','','width='+sw+',height='+sh+',top=0,left=0,scrollbars=1');
// The above is the closest you are going to get to opening a fullscreen window without being malicious
// Using the onload will trigger popup blockers and see the window as a popup and almost always block it
}
//-->
</script>
</head>
<body onload="openwin()">

</body>
</html>
and because of the popup blockers this is what the splash page would be neccesary for because it doesn't seem to get blocked when its opened from a link

supernuke
03-15-2005, 02:56 PM
thanks, but that code opens a new window, and does it with javascript, then it will be caught by the hotlinking protection and will not be displayed, thats why i need to resize the filan window, doing like this the page will first open surely and then it will resize as i need.

I tried this code with activex, it almost opens in fullscreen but it has also navigation bars and other extra stuff i want to take off, any idea about how to do it?

_Aerospace_Eng_
03-15-2005, 08:48 PM
i should have put this in my last post, u can't change the window attributes unless its opened by javascript, which is what i've been trying to tell u the last 2 posts

supernuke
03-16-2005, 03:21 AM
I know that, thats why i dont want to open a new window but to resize the current one. i think this code is the closest one to be accurrated i have tried it and it nearly worked,

<script type="text/javascript">
function max()
{
var obj = new ActiveXObject("Wscript.shell");
obj.SendKeys("{F11}");
}
</script>
</head>
<body onload="javascript:max()">

but it has only one problem, search bar (in case you have installed one) navigation bar and window options (close, minimize, maximize) still appear and resting visibility to the window, that is what i want to avoid. I have warned users they have to press ALT and F4 to close the window, so there is no problem with that, any expert in this code around?

codegoboom
03-16-2005, 09:00 AM
What you need is either the InternetExplorer object, or an HTA; both of which are for 'trusted web applications'--not 'ordinary web pages', and you shouldn't rely on sendkeys too heavily either, because it's 'blind' (you can't ensure that another window will not grab focus before the sending, or what will happen if you 'miss'). Basically, these things do not work on the internet, by design.

supernuke
03-17-2005, 10:16 AM
isnt there any alternative code? even in activex, i think its close to work fine

codegoboom
03-17-2005, 12:57 PM
Nope.

supernuke
03-18-2005, 06:06 PM
i believe there is a code somewhere to do that

codegoboom
03-18-2005, 06:23 PM
Godspeed. :cool:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum