...

View Full Version : window events in HTA



oinas
09-16-2005, 09:00 AM
I have problems with HTA =(

Update.

I have *.hta file which loads external html page into <iframe>. For now hta-file is about 240 K and is loaded very slowly. So at the begining of script there were following lines:

window.resizeTo(1,1);
window.moveTo(5000,5000);

and coreesponding lines to move window to the center of screen -some naive trick to avoid appearence of blank window.

Sometimes we have had an "Access denied" error at these lines in windows XP. We have never had them in another OSs. We got similar errors every time then clicked left mouse button on the moving window, but I have doubt that it was a mouseclick in situation described =)

Why we have "Access denied" errors sometimes when resizing or moving the HTA window ?

Canuck WebGeek
09-16-2005, 03:45 PM
moving a window off the screen (beyond the borders) is actually a security flaw that some sleazier pop-up adds used to hide a window from unsespecting users, allowing them to contually spawn new pop-ups after the user left the original page. Microsoft removed this ability in Javascript as a result.

Instead of silently ignoring this call (like Netscape) it now throws an error.

Also note that windows cannot be created with widths or heights less than 100 pixels. anything less will be ignored and replaced with 100.

oinas
09-16-2005, 04:24 PM
it isn't a pop-up.It's just an application which I don't want to see before it's loaded ;)

well, if no way around I can accept white window.
But why does moving it back to the screen fail? And why it fails only sometimes?


Also note that windows cannot be created with widths or heights less than 100 pixels. anything less will be ignored and replaced with 100.

erm, I've just tried to create 10*10 window, and it does work!

Canuck WebGeek
09-16-2005, 04:28 PM
ok, maybe that's different for hta apps. I don't know.

but any window isn't allowed to move off the screen, as far as I know.

KC-Luck
09-16-2005, 06:31 PM
check out this :)
Access Denied when trying to move Internet Explorer (http://support.microsoft.com/?kbid=904947)

When you try to move or resize a window on a Microsoft Windows Server 2003 Service Pack 1-based or Microsoft Windows XP Service Pack 2-based computer, you may receive an error message that is similar to the following:
Access Denied
This problem occurs when you use a drag operation to move or to resize a Microsoft Internet Explorer window or the window of another application.
you can wrap them with try{}catch(ignore){} to prevent the error.
but would not do the method if it occurs.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum