Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Hosting and Reuse
MSHTML Reference
IHTMLWindow2
 moveTo Method
IHTMLWindow2::moveTo Method

Moves the screen position of the upper-left corner of the window to the specified x and y position.

Syntax

HRESULT moveTo(      
    long x,     long y );

Parameters

x
[in] long that specifies the horizontal scroll offset in pixels. The value can be either positive or negative.
y
[in] long that specifies the vertical scroll offset in pixels. The value can be either positive or negative.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

This method is not valid with windows created using the IHTMLWindow2::showModalDialog or IHTMLWindow3::showModelessDialog methods. In order to move or resize a dialog window created with these methods, change the IHTMLDialog::dialogHeight, IHTMLDialog::dialogWidth, IHTMLDialog::dialogTop, and IHTMLDialog::dialogLeft properties.

If the page (that contains this script) is hosted within an IFRAME, the IFRAME will move relative to the upper-left corner of the content area.

Windows XP Service Pack 2 (SP2) or later. Windows that are located in the Internet Zone are subject to Window_Restrictions and will be forced to stay on screen. This applies to IHTMLWindow2::moveTo, IHTMLWindow2::moveBy, IHTMLWindow2::resizeTo, and IHTMLWindow2::resizeBy methods.

Note  When operating in high-dpi mode, pixel values are scaled up accordingly. See Adjusting Scale for Higher DPI Screens for additional information.

Windows Internet Explorer 7. This method is only effective when a single tab is open or when tabbed browsing is disabled. If multiple tabs are open, this method is blocked. For information regarding tab interaction from a script, see Tabbed Browsing for Developers.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker