ceregclosekey (rapi)
Last changed: -122.170.5.108

.
Summary
This function releases the handle of the specified key.

C# Signature:

[DllImport("rapi.dll")]
public static extern int CeRegCloseKey(uint hkey);

User-Defined Types:

None.

Notes:

function info on msdn at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceactsy/html/cerefCeRegCloseKeyRAPI.asp

Tips & Tricks:

Please add some!

Sample Code:

ret = CeRegQueryValueEx(key, regKeyName, 0, ref lpType, lpData, ref lpcbData);

if (ret != 0)

{

    // if CeRegQueryValueEx fails then close already opened reg
    CeRegCloseKey(key);
    return ret;

}

CeRegCloseKey(key);

Alternative Managed API:

Documentation