?
Solved

VBScript IE Window Always on Top / Cannot Move

Posted on 2009-02-20
4
Medium Priority
?
1,411 Views
Last Modified: 2012-05-06
Hi,

How can I ensure that my IE window always opens in a fixed position, is always on top and cannot be moved? I have created a ticker app which I always want at the top of the screen where no other applications can hide it from view.

Thanks,

Mike
0
Comment
Question by:Barnardos_2LS
  • 3
4 Comments
 
LVL 14

Accepted Solution

by:
yehudaha earned 2000 total points
ID: 23691509
i don't think there is nay way to do it with hta but

i wrote a code on the same idea from this article:
http://www.microsoft.com/technet/scriptcenter/topics/htas/autorefresh.mspx

i used a timer to call a sub and move the windows back, but notice holding
the windows end to much time will cause an error

 try this code maybe it will help you:
<html>
 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>My HTML Application</title>
<SCRIPT Language="VBScript">
 
    Sub Window_Onload
        window.resizeTo window.screen.width,window.screen.height
        window.moveto 0,0
        window.setInterval "moveback", 500, "vbscript"
    End Sub
    Sub moveback()
        window.moveto 0,0
    End Sub
 
</SCRIPT>
<hta:application
 applicationname="MyHTA" 
 border="dialog"
 borderstyle="dialog"
 caption="My HTML Application"
 contextmenu="no"
 icon="myicon.ico"
 maximizebutton="no"
 minimizebutton="no"
 navigable="no"
 scroll="no"
 selection="no"
 showintaskbar="yes"
 singleinstance="yes"
 sysmenu="no"
 version="1.0"
 windowstate="maximize"
>
</head>
<body>
<!-- HTML goes here -->
 
</body>
</html>

Open in new window

0
 
LVL 14

Expert Comment

by:yehudaha
ID: 23691517
<html>
 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>My HTML Application</title>
<SCRIPT Language="VBScript">
 
    Sub Window_Onload
        window.resizeTo window.screen.width,window.screen.height
        window.moveto 0,0
        window.setInterval "moveback", 500
    End Sub
    Sub moveback()
        window.moveto 0,0
    End Sub
 
</SCRIPT>
<hta:application
 applicationname="MyHTA"
 border="dialog"
 borderstyle="dialog"
 caption="My HTML Application"
 contextmenu="no"
 icon="myicon.ico"
 maximizebutton="no"
 minimizebutton="no"
 navigable="no"
 scroll="no"
 selection="no"
 showintaskbar="yes"
 singleinstance="yes"
 sysmenu="no"
 version="1.0"
 windowstate="maximize"
>
</head>
<body>
<!-- HTML goes here -->
 
</body>
</html>
0
 
LVL 14

Expert Comment

by:yehudaha
ID: 23691525
opps

the same code don't worry
0
 
LVL 1

Author Closing Comment

by:Barnardos_2LS
ID: 31549207
Excellent. Thanks for your help.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Integration Management Part 2
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question