IShellWindows::Item method (exdisp.h)

Returns the registered Shell window for a specified index.

Syntax

HRESULT Item(
  [in, optional] VARIANT   index,
  [out, retval]  IDispatch **Folder
);

Parameters

[in, optional] index

Type: VARIANT

A VARIANT of type VT_UI4, VT_I2, or VT_I4. If the type is VT_UI4, the value of index is interpreted as a member of ShellWindowTypeConstants; in this case, Item returns the window that is closest to the foreground window and has a matching type. If the type is VT_I, or VT_I4, index is treated as an index into the Shell windows collection.

[out, retval] Folder

Type: IDispatch**

A reference to the window's IDispatch interface, or NULL if the specified window was not found.

Return value

Type: HRESULT

One of the following values, or a standard result code.

Return code Description
S_OK
The specified window was found.
S_FALSE
The specified window was not found.

Requirements

Requirement Value
Target Platform Windows
Header exdisp.h
DLL Shdocvw.dll (version 5.00.2014.0216 or later)

See also

IShellWindows

IShellWindows::_NewEnum

IShellWindows::get_Count