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.
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.
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.
|
-- create a link to the Registry |
-- |
-- get x,y, data to plot |
|
-- create a new CPlotView for the plot |
|
-- fetch the handle of the existing plot window |
|
-- attach the handle to the window |
|
-- add a new data point to the existing plot |