CImageView:AttachHandle


The AttachHandle method attaches a window handle to this CImageView object. The handle may have been obtained from the System Registry using the CRegistry:GetWnd method.

Syntax

bSuccess = CImageView:AttachHandle( handle )

where

    handle is the handle of an image window displayed on the Mira desktop.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

The window handle applies only to a specific image window displayed on the Mira desktop. If you close an image window and create a new image window, the new window will have a different handle value. Use this method to fetch the handle of an existing GUI image window that was saved by a previous script.

Example

The following script fetches the handle of an existing GUI image window from the registry, attaches the handle to a CImageView object, and then displays a new image in the window. It is assumed that the image window's handle was saved to the Registry by a prior script.

 

Reg = CRegistry:new("ImageData")

-- create a link to the Registry

  --

-- get a CImage, I, to display

V = CImageView:new()

-- create a new CImageView object

handle = Reg:GetWnd( "ImageWindow" )

-- fetch the handle of the existing GUI image window

V:AttachHandle( handle )

-- attach the handle to this CImageView object

V:Display( I )

-- display the CImage in the existing image window

Related Topics

GetHandle

CImageView class

CRegistry:GetWnd