IHTMLWindow2::moveBy
IHTMLWindow2

IHTMLWindow2::moveBy


HRESULT moveBy(
    long x,
    long y
);

Currently not implemented, and has no effect when called.

IHTMLWindow2::moveTo

HRESULT moveTo(
    long x,
    long y 
);

Currently not implemented, and has no effect when called.

See also scrollBy

IHTMLWindow2::navigate

HRESULT navigate(
    BSTR url 
);

Causes the browser to browse to the location specified by the URL.

v
String specifying the URL.

This method performs the same action as the IHTMLLocation::put_href method.

IHTMLWindow2::open

HRESULT open(
    BSTR url,
    BSTR name,
    BSTR features,
    VARIANT_BOOL replace,
    IHTMLWindow2 **pomWindowResult
);

Opens a new Web browser window.

url
String specifying the URL of the document to display in the new window.
name
String specifying the name of the new window.
features
String specifying the ornaments to add to the new window. This parameter is a list of items separated by semicolons. Each item consists of an option and a value, separated by a colon (for example, "fullscreen:yes;toolbar:yes"). The following table lists the supported options.

Attribute    Values    Description   
fullscreen    yes/no/1/0    Browser displays in full-screen (true) or normal window (false) mode.
toolbar yes/no/1/0 Browser toolbar (Back and Forward buttons, and so on)
location yes/no/1/0 Input field for entering URLs directly into the browser.
directories yes/no/1/0 Directory buttons.
status yes/no/1/0 Status line at bottom of window.
menubar yes/no/1/0 Menu bar.
scrollbars yes/no/1/0 Horizontal and vertical scroll bars are enabled.
resizable yes/no/1/0 Do resize handles appear at the edge.
width pixel Width of window; defaults to pixels.
height pixel Height of window; defaults to pixels.
top pixel Top position, in pixels, in relation to the desktop.
left pixel Left position, in pixels, in relation to the desktop.

replace
Replace history flag. If TRUE, the URL that is loaded into the new page replaces the current entry in the window's browsing history. If FALSE, a new entry is created in the window's browsing history.
pomWindowResult
Address of a variable that receives an interface pointer to the new window object.

IHTMLWindow2::prompt

HRESULT prompt(
    BSTR message,
    BSTR defstr,
    VARIANT *textdata
);

Displays a Prompt dialog box with a message, an input field, and OK and Cancel buttons.

message
String specifying the message to display in the dialog box.
defstr
String specifying the default value of the input field. If this parameter is NULL, the dialog box displays the value <undefined>.
textdata
Address of a variable that receives the text that the user enters into the input field.

The title bar of the prompt dialog box cannot be changed.

See also alert, confirm

IHTMLWindow2::put_defaultStatus

HRESULT put_defaultStatus( 
    BSTR v 
);

Sets the default message displayed in the status bar at the bottom of the window.

v
String specifying the status message.

Do not confuse the defaultStatus property with the status property set by the put_status method. The status property reflects a priority or transient message in the status bar, such as the message that appears when an onmouseover event occurs over an anchor.

See also get_defaultStatus

IHTMLWindow2::put_name

HRESULT put_name( 
    BSTR v 
);

Sets the name of the window.

v
String specifying the name.

The name property on the window comes from the FRAME definition. There is no other way to persist a window name in HTML.

See also get_name

IHTMLWindow2::put_offscreenBuffering

HRESULT put_offscreenBuffering(
    VARIANT v 
);

Specifies whether to use an offscreen buffer.

v
Value specifying whether to use an offscreen buffer.

See also get_offscreenBuffering

IHTMLWindow2::put_onbeforeunload

HRESULT put_onbeforeunload(
    VARIANT v 
);

Sets the inline script associated with the onbeforeunload event before a window element is unloaded. This event is fired before the onunload event. It provides an opportunity to warn the user if the window is currently in an unsaved state and the information will be lost.

For more information on inline script, see Attaching an Event Handler in the Event Model documentation.

v
VARIANT structure that contains the script to be set.

The handler for this event should return NULL if doing the unload is safe, or a text string to prompt the user to decide to cancel or continue with the unload operation. Only the user's response to the warning can stop the new navigation causing the unload; the event handler itself cannot unilaterally block the operation. If the handler returns a non-NULL string, a modal dialog box appears that displays the explanatory string. The dialog box shows three buttons with the message for user action:

In the case of frames, the full sequence of onbeforeunload events is fired on each frame in the same order, depth-first, that onunload events are about to be fired. A dialog box is presented for each event handler that returns a non-NULL string. The first Cancel response stops the potential navigation, in which case no unload occurs. If there is no Cancel response, the unload proceeds and onunload events fire.

See also get_onbeforeunload

IHTMLWindow2::put_onblur

HRESULT put_onblur(
    VARIANT v 
);

Sets the inline script associated with the onblur event when the window element loses the focus.

For more information on inline script, see Attaching an Event Handler in the Event Model documentation.

v
VARIANT structure that contains the script to be set.

See also get_onblur

IHTMLWindow2::put_onerror

HRESULT put_onerror(
    VARIANT v 
);

Sets the inline script associated with the onerror event on the window element.

For more information on inline scripts, see Attaching an Event Handler in the Event Model documentation.

v
VARIANT structure that contains the onerror script to be set.

See also get_onerror

IHTMLWindow2::put_onfocus

HRESULT put_onfocus(
    VARIANT v 
);

Sets the inline script associated with the onfocus event on the window element. This script is executed when the window receives focus.

For more information on inline scripts, see Attaching an Event Handler in the Event Model documentation.

v
VARIANT structure that contains the onfocus script to be set.

See also get_onfocus

IHTMLWindow2::put_onhelp

HRESULT put_onhelp(
    VARIANT v 
);

Sets the inline script associated with the onhelp event on the window element. This script is executed when the user presses the F1 key or clicks the help button in the browser.

For more information on inline scripts, see Attaching an Event Handler in the Event Model documentation.

v
VARIANT structure that contains the onhelp script to be set.

See also get_onhelp

IHTMLWindow2::put_onload

HRESULT put_onload( 
    VARIANT v 
);

Sets the inline script associated with the onload event on the window element. This script is executed immediately after the browser loads the given object.

For more information on inline scripts, see Attaching an Event Handler in the Event Model documentation.

v
VARIANT structure that contains the onload script to be set.

See also get_onload

IHTMLWindow2::put_onresize

HRESULT put_onresize(
    VARIANT v 
);

Specifies code to execute whenever the window is resized.

v
VARIANT structure that contains the script to be set.

See also get_onresize

IHTMLWindow2::put_onscroll

HRESULT put_onscroll(
    VARIANT v 
);

Specifies code to execute when the scroll box is repositioned. The default action of this event is to scroll.

v
VARIANT structure that contains the script to be set.

See also get_onscroll

IHTMLWindow2::put_onunload

HRESULT put_onunload(
    VARIANT v 
);

Specifies code to execute immediately before the page is unloaded.

v
VARIANT structure that contains the script to be set.

See also get_onunload

IHTMLWindow2::put_opener

HRESULT put_opener( 
    VARIANT v 
);

Sets a reference to the window that created the current window.

v
String or value specifying the reference to the creating window.

See also get_opener

IHTMLWindow2::put_status

HRESULT put_status(
    BSTR v 
);

Sets the message displayed in the status bar at the bottom of the window.

v
String specifying the status message.

Do not confuse the status property with the defaultStatus property set by the put_defaultStatus method. The status property reflects a priority or transient message in the status bar, such as the message that appears when an onmouseover event occurs over an anchor.

See also get_status

IHTMLWindow2::resizeBy

HRESULT resizeBy(
    long x,
    long y
);

Currently not implemented, and has no effect when called.

See also resizeTo

IHTMLWindow2::resizeTo

HRESULT resizeTo(
    long x,
    long y
);

Currently not implemented, and has no effect when called.

See also resizeBy

IHTMLWindow2::scroll

HRESULT scroll(
    long x,
    long y
);

Scrolls the window to the specified x and y offset relative to the entire document.

x
Value specifying the x offset.
y
Value specifying the y offset.

IHTMLWindow2::scrollBy

HRESULT scrollBy(
    long x,
    long y 
);

Scrolls the document horizontally by the x value provided, and scrolls the document vertically by the y value provided.

x
Long integer that contains the value for the x direction scroll distance.
y
Long integer that contains the value for the y direction scroll distance.

See also scrollTo

IHTMLWindow2::scrollTo

HRESULT scrollTo(
    long x, 
    long y 
);

Given the area specified as (X,Y) in document coordinates, scrolls the document to that position.

x
Long integer that contains the value for the x direction scroll position coordinate.
y
Long integer that contains the value for the y direction scroll position coordinate.

IHTMLWindow2::setInterval

HRESULT setInterval(
    BSTR expression,
    long msec,
    VARIANT *language,
    long *timerID
);

Calls a function repeatedly, or evaluates an expression after a specified number of milliseconds has elapsed.

expression
String specifying the code to be executed repeatedly at the specified interval.
msec
Numeric value or numeric string specifying the time-out interval, in milliseconds.
language
String specifying the language that the code is executed in.
timerID
Address of a variable that receives a time-out identifier. This identifier is used only to cancel the evaluation with the clearInterval method.

See also clearInterval

IHTMLWindow2::setTimeout

HRESULT setTimeout( 
    BSTR expression,
    long msec,
    VARIANT *language,
    long *timerID 
);

Evaluates an expression after a specified number of milliseconds has elapsed.

expression
String specifying the code to be executed repeatedly at the specified interval.
msec
Numeric value or numeric string specifying the time-out interval, in milliseconds.
language
String specifying the language that the code is executed in.
timerID
Address of a variable that receives a time-out identifier. This identifier is used only to cancel the evaluation with the clearTimeout method.

See also clearTimeout

IHTMLWindow2::showHelp

HRESULT showHelp(
    BSTR helpURL,
    VARIANT helpArg,
    BSTR features 
);

Displays a help file.

helpURL
String specifying the URL of the help file.
helpArg
String or value specifying the programmer-defined arguments to pass to the dialog box.
features
Reserved; do not use.

IHTMLWindow2::showModalDialog

HRESULT showModalDialog(
    BSTR dialog,
    VARIANT *varArgIn,
    VARIANT *varOptions,
    VARIANT *varArgOut
);

Displays an HTML dialog box.

dialog
String specifying the URL of the dialog box.
varArgIn
Address of a variable that contains programmer-defined arguments to pass into the dialog box.
varOptions
String specifying the attributes of the dialog box. This parameter is a list of items separated by semicolons. Each item consists of an option and a value, separated by a colon (for example, "dialogWidth:200;dialogHeight:100"). The following table lists the supported options.

Attribute    Values    IE3/IE4 Description   
dialogWidth pixel IE3/IE4 Sets the width of the window, in pixels.
dialogHeight pixel IE3/IE4 Sets the height of the window, in pixels.
dialogTop pixel IE3/IE4 Sets the top position of the window, in pixels, relative to the desktop.
dialogLeft pixel IE3/IE4 Sets the left position of the window, in pixels, relative to the desktop.
center yes/no/1/0 Not yet implemented in IE4. Centered relative to the desktop.
font font-family Not yet implemented in IE4.
font-size Not yet implemented in IE4.
font-weight Not yet implemented in IE4.
font-style Not yet implemented in IE4. Describes the font and font attributes. The syntax should look like CSS. For example, font:3;font-size:4. To define multiple font values, use multiple font attributes.
edgeStyle raised/sunken Not yet implemented in IE4. Sets the style of the window border.
borderSize thick/thin Not yet implemented in IE4. Sets the thickness of the window border.
help yes/no/1/0 Not yet implemented in IE4. Determines whether the help icon appears in the title bar
min yes/no/1/0 Not yet implemented in IE4. Determines whether the minimize button appears in the title bar.
max yes/no/1/0 Not yet implemented in IE4. Determines whether the maximize button appears in the title bar.
system menu yes/no/1/0 Not yet implemented in IE4. Determines whether the system menu is available from the border icon.
sync yes/no/1/0 Not yet implemented in IE4.

varArgOut
Address of a variable that receives a return value from the dialog box. For more information, see IHTMLDialog::put_returnValue and IHTMLDialog::get_returnValue.

IHTMLWindow2::toString

HRESULT toString( 
    BSTR *String 
);

Retrieves a string representation of the window object.

String
Address of a variable that receives the string representation.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.