Share via


AddDesktopComponent method

Adds a Web site or image to the Microsoft Active Desktop.

Syntax

var retval = external.AddDesktopComponent(URL, Type, Left, Top, Width, Height);

Parameters

URL [in]

Type: BSTR

A String that specifies the location of the Web site or image to be added to the Active Desktop.

Type [in]

Type: BSTR

A String containing one of the following values that specify the type of item to add.

image

Specifies the component is an image.

website

Specifies the component is a Web site.

Left [in, optional]

Type: VARIANT

Variant of type Integer that specifies the position of the left edge, in screen coordinates.

Top [in, optional]

Type: VARIANT

Variant of type Integer that specifies the position of the top edge, in screen coordinates.

Width [in, optional]

Type: VARIANT

Variant of type Integer that specifies the width, in screen units.

Height [in, optional]

Type: VARIANT

Variant of type Integer that specifies the height, in screen units.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The user must have Active Desktop installed for this method to work. If Active Desktop is not installed, this method is not invoked.

This method is not supported in HTML Applications (HTAs).

Examples

This example uses the AddDesktopComponent method to add the Microsoft Web site as an Active Desktop component.

window.external.AddDesktopComponent(
   "https://www.microsoft.com",
   "website",
   100,100,200,200
);