<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hey, Scripting Guy! How Can I Get an HTA to Remember Its Previous Position Onscreen?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/07/how-can-i-get-an-hta-to-remember-its-previous-position-onscreen.aspx</link><description>Hey, Scripting Guy! Is there any way to get an HTA to remember its previous position onscreen? Some of my users are very particular about moving an HTA to a specific spot on the screen, then wanting it to reappear at that same spot the next time they</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Hey, Scripting Guy! How Can I Get an HTA to Remember Its Previous Position Onscreen?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/07/how-can-i-get-an-hta-to-remember-its-previous-position-onscreen.aspx#3433484</link><pubDate>Mon, 06 Jun 2011 01:42:32 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3433484</guid><dc:creator>'Angel</dc:creator><description>&lt;p&gt;As Sarkie says, none of these scripts work.&lt;/p&gt;
&lt;p&gt;Unfortunately, Microsoft did not provide this for an HTA,&lt;/p&gt;
&lt;p&gt;why is this.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3433484" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get an HTA to Remember Its Previous Position Onscreen?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/07/how-can-i-get-an-hta-to-remember-its-previous-position-onscreen.aspx#3381164</link><pubDate>Wed, 19 Jan 2011 08:48:09 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3381164</guid><dc:creator>Sarkie</dc:creator><description>&lt;p&gt;Well, I must say, none of these scripts work.&lt;/p&gt;
&lt;p&gt;Unfortunate because this would be an interesting solution for an HTA&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3381164" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get an HTA to Remember Its Previous Position Onscreen?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/07/how-can-i-get-an-hta-to-remember-its-previous-position-onscreen.aspx#3375627</link><pubDate>Thu, 16 Dec 2010 21:41:54 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3375627</guid><dc:creator>Pavlus</dc:creator><description>&lt;p&gt;To get the REAL top left corner of your HTA window just run it at the beginig:&lt;/p&gt;
&lt;p&gt;var xoffset = screenLeft;&lt;/p&gt;
&lt;p&gt;var yoffset = screenTop;&lt;/p&gt;
&lt;p&gt;window.moveTo(xoffset,yoffset);&lt;/p&gt;
&lt;p&gt;xoffset -= screenLeft;&lt;/p&gt;
&lt;p&gt;yoffset -= screenTop;&lt;/p&gt;
&lt;p&gt;xoffset,yoffset - is your &amp;quot;theme offset&amp;quot;, the difference between window and client screen coordinates. To get real top left coords do:&lt;/p&gt;
&lt;p&gt;winLeft = screenLeft + xoffset;&lt;/p&gt;
&lt;p&gt;winTop = screenTop + yoffset;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3375627" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get an HTA to Remember Its Previous Position Onscreen?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/07/how-can-i-get-an-hta-to-remember-its-previous-position-onscreen.aspx#3375495</link><pubDate>Thu, 16 Dec 2010 14:17:52 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3375495</guid><dc:creator>herky</dc:creator><description>&lt;p&gt;tooooo bad window.offscreenBuffering = true is not working ... :( would be really good to have that. never the less &lt;/p&gt;
&lt;p&gt;&amp;lt;pre&amp;gt;&lt;/p&gt;
&lt;p&gt;		Sub Window_onLoad&lt;/p&gt;
&lt;p&gt;			window.offscreenBuffering = true&lt;/p&gt;
&lt;p&gt;			Dim OuterWidth		&amp;#39;	initial outer Size width&lt;/p&gt;
&lt;p&gt;			Dim OuterHeight		&amp;#39;	initial outer Size height&lt;/p&gt;
&lt;p&gt;			Dim intLeft		&amp;#39;	initial Left distance&lt;/p&gt;
&lt;p&gt;			Dim intTop		&amp;#39;	initial Top distance&lt;/p&gt;
&lt;p&gt;			Dim intHlafW		&amp;#39;	middle pos x&lt;/p&gt;
&lt;p&gt;			Dim intHalfH		&amp;#39;	middle pos y&lt;/p&gt;
&lt;p&gt;			Dim BorderWidth		&amp;#39;	calc border w (both sides in one)&lt;/p&gt;
&lt;p&gt;			Dim BorderHeight	&amp;#39;	calc border h (both sides in one ! Bottom -&amp;gt; like BorderWidth/2)&lt;/p&gt;
&lt;p&gt;			OuterWidth		=	400&lt;/p&gt;
&lt;p&gt;			OuterHeight		=	250&lt;/p&gt;
&lt;p&gt;			window.ResizeTo			OuterWidth,OuterHeight&lt;/p&gt;
&lt;p&gt;			window.MoveTo			0,0&lt;/p&gt;
&lt;p&gt;			BorderWidth		=	OuterWidth-document.body.clientWidth&lt;/p&gt;
&lt;p&gt;			BorderHeight		=	OuterHeight-document.body.clientHeight&lt;/p&gt;
&lt;p&gt;			intHlafW		=	Round((OuterWidth+BorderWidth)/2)&lt;/p&gt;
&lt;p&gt;			intHalfH		=	Round((OuterHeight+BorderHeight)/2)&lt;/p&gt;
&lt;p&gt;			Const ForReading = 1&lt;/p&gt;
&lt;p&gt;				Set objFSO = CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)&lt;/p&gt;
&lt;p&gt;					Set objFile = objFSO.OpenTextFile(&amp;quot;HTA.ini&amp;quot;, ForReading)&lt;/p&gt;
&lt;p&gt;				strContents = objFile.ReadAll&lt;/p&gt;
&lt;p&gt;			objFile.Close&lt;/p&gt;
&lt;p&gt;			arrContents = Split(strContents, &amp;quot;,&amp;quot;)&lt;/p&gt;
&lt;p&gt;			window.moveTo (arrContents(0)-intHlafW), (arrContents(1)-intHalfH)&lt;/p&gt;
&lt;p&gt;			window.ResizeTo			OuterWidth+BorderWidth,OuterHeight+BorderHeight&lt;/p&gt;
&lt;p&gt;		End Sub&lt;/p&gt;
&lt;p&gt;		Sub Window_onBeforeUnLoad&lt;/p&gt;
&lt;p&gt;			intLeft = window.screenLeft+intHlafW-(BorderWidth/2)&lt;/p&gt;
&lt;p&gt;			intTop = window.screenTop+intHalfH-(BorderHeight-BorderWidth/2)&lt;/p&gt;
&lt;p&gt;			Const ForWriting = 2&lt;/p&gt;
&lt;p&gt;				Set objFSO = CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)&lt;/p&gt;
&lt;p&gt;					Set objFile = objFSO.OpenTextFile(&amp;quot;HTA.ini&amp;quot;, ForWriting)&lt;/p&gt;
&lt;p&gt;				objFile.WriteLine intLeft &amp;amp; &amp;quot;,&amp;quot; &amp;amp; intTop&lt;/p&gt;
&lt;p&gt;			objFile.Close&lt;/p&gt;
&lt;p&gt;		End Sub&lt;/p&gt;
&lt;p&gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3375495" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get an HTA to Remember Its Previous Position Onscreen?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/07/how-can-i-get-an-hta-to-remember-its-previous-position-onscreen.aspx#3375250</link><pubDate>Wed, 15 Dec 2010 15:48:40 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3375250</guid><dc:creator>herky</dc:creator><description>&lt;p&gt;cool thing - although offscreenBuffering isn&amp;#39;t working :( tried a around but my hta still jumps to the new position instead of appearing.&lt;/p&gt;
&lt;p&gt;help appreciated ;)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3375250" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get an HTA to Remember Its Previous Position Onscreen?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/07/how-can-i-get-an-hta-to-remember-its-previous-position-onscreen.aspx#3369591</link><pubDate>Thu, 18 Nov 2010 15:31:24 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3369591</guid><dc:creator>xpietoe</dc:creator><description>&lt;p&gt;There seems to be a problem with this in that the moveto method is relative to the top left of the outer window, including the menu bar and window frame. &amp;nbsp;The screenLeft/Top properties are relative to the inner window, excluding the menu bar and window frame. This results in an offset of 4px,30px - if XP themes are turned on. &amp;nbsp;Or, an offset of 4px,23px if XP themes are off. &amp;nbsp;To be percise, you would then need to query for the theme state, then adjust your window offset accordingly (intTop = window.ScreenTop-23, etc)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3369591" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get an HTA to Remember Its Previous Position Onscreen?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/07/how-can-i-get-an-hta-to-remember-its-previous-position-onscreen.aspx#3264597</link><pubDate>Wed, 15 Jul 2009 12:17:53 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3264597</guid><dc:creator>finbom</dc:creator><description>&lt;p&gt;Hi. I prefer to store this kind of settings in the registry. :)&lt;/p&gt;
&lt;p&gt;This way settings follow the user (if using roaming profiles) when changing computer.&lt;/p&gt;
&lt;p&gt;Otherwise. cool! :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3264597" width="1" height="1"&gt;</description></item></channel></rss>