CRegistry:GetWnd


The GetWnd method returns a window handle from a registry key. If the value does not exist in the registry, nil is returned.

Syntax

handle = CRegistry:GetWnd( sName )

    handle is a GUI window handle returned from the Registry.

    sName is the name of the handle to fetch.

Remarks

Note that the handle applies only to a specific window displayed on the Mira desktop. If you close the window for a handle and then create a new window of the same type, it will have a different handle value. Use this method when you want to fetch the handle of an existing window between scripts.

Example

The following script opens a key specified by sKeyName and returns a window handle saved under the name "Window":

R = CRegistry:Open( sKeyName )

-- open the key and create a CRegistry object

h = R:GetWnd( "Window" )

-- fetch the value of "Window"

Printf( "Window handle= \'%s\' ", h )

-- Result: Window handle= nil (the value did not exist)

Related Topics

CRegistry, SetWnd