Description

Exposes an McWindow from the McWindows collection.

Property type

A McWindow object.  

Syntax

object.Item(NameImageOrIndex, [WindowNumber])

The Item Property syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McWindows.
NameImageOrIndexRequired. A Variant value.

If a string then this argument is either the McWindow.Name desired (if the WindowNumber argument is the default of -1) or is the McWindow.View.ImageToDisplay.Name desired (if the WindowNumber argument is any positive number or mcLastWindowNumber). If an McImage object instance, then this is the McWindow.View.ImageToDisplay desired, and the WindowNumber argument will determine which McWindow displaying that image is returned. If a numeric value, then the value is a index (zero-based) into the collection.

WindowNumberOptional. A Long value.

The target WindowNumber of the McWindow to get. If the default value of -1, then any string NameImageOrIndex argument is treated as the McWindow.Name property of the McWindow instance to return. If the NameImageOrIndex argument is a numeric value then this argument is ignored.

Otherwise, this argument is the target McWindow.WindowNumber property of the desired McWindow. A value of -1, 0 or 1, will always return the first (or only) window associated with the McWindow.View.ImageToDisplay given by the NameImageOrIndex argument. The McImage.WindowNumber of this first window will be either 0 (there is only one McWindow displaying the image) or 1 (there are more than one windows displaying the image).

The constant mcLastWindowNumber, or any large number, can be given to indicate that the last McWindow associated with the NameImageOrIndex argument should be returned. Other than interating through all of the windows, this is the only way to find out how many windows are open displaying a given image (see Example 2).

Remarks

The McWindow can be accessed by the McWindow.Name, by the Name of the McImage that it is displaying, by the McImage object being displayed, or by index into the collection.

Exceptions

E_INVALIDARG is thrown when the window can't be found.

Notes

When accessing by index value, there is no guarantee that the index of any given McWindow instance will stay the same when other McWindow instances are opened or closed. Similarly, there is no guarantee that the McWindow.WindowNumber property will stay the same as other windows are opened or closed displaying the same McImage. Thus, access by the McWindow.Name property (by passing in the McWindow.Name as the NameImageOrIndex argument, and leaving the WindowNumber its default value of -1) is the only way to reliably retrieve a known McWindow object instance.