CRegistry:GetWnd


The GetWnd method returns a GUI window handle from a registry key. Use this method when you want to fetch the handle of a window that persists between scripts.

Syntax

handle = CRegistry:GetWnd( sName )

where

    handle is a GUI window handle returned from the Registry.

    sName is the name of the registry key containing the handle.

    returns nil if the Registry entry does not exist.

  

Note that the handle is a number that the operating system has assigned to a specific GUI window. If you close the window of a particular type and then create a new window of the same type, the new window's handle will be different.

Example

The following script fetches the handle of an existing plot window from the Registry, attaches a CPlotView object to the window, then adds a new data point to the plot. This highlighted text shows how the current method is used to fetch the handle.

Reg = CRegistry:new("Real-time-phot")

-- create a link to the Registry

  --

-- get x,y, data to plot

P = CPlotView:new()

-- create a new CPlotView for the plot

handle = Reg:GetWnd( "PlotWindow" )

-- fetch the handle of the existing plot window

P:SetWnd( handle )

-- attach the handle to the window

P:Add( x, y, ye )

-- add a new data point to the existing plot

Related Topics

SetWnd

CRegistry class