Partager via


CeRegOpenKeyEx (RAPI) (Windows CE 5.0)

Send Feedback

This function opens the specified key.

CeRegOpenKeyEx is a remote application programming interface (RAPI), which enables an application running on a desktop computer to make function calls on a Windows CE–based device.

A Windows CE registry API version of this function exists, and it is called RegOpenKeyEx.

LONGCeRegOpenKeyEx( HKEYhKey, LPCWSTRlpszSubKey, DWORDulOptions, REGSAMsamDesired, PHKEYphkResult);

Parameters

  • hKey
    [in] Handle to a currently open key or any of the following predefined reserved handle values:

    • HKEY_CLASSES_ROOT
    • HKEY_CURRENT_USER
    • HKEY_LOCAL_MACHINE
    • HKEY_USERS

    Windows CE does not support the HKEY_CURRENT_CONFIG, HKEY_PERFORMANCE_DATA, or HKEY_DYN_DATA predefined reserved handle values.

  • lpszSubKey
    [in] Pointer to a null-terminated string containing the name of the subkey to open. If this parameter is NULL or a pointer to an empty string, the function will open a new handle to the key identified by the hKey parameter. In this case, the function will not close the handles previously opened.

  • ulOptions
    [in] Reserved; set to 0.

  • samDesired
    [in] Not supported; set to 0.

  • phkResult
    [out] Pointer to a variable that receives a handle to the opened key. When you no longer need the returned handle, call the CeRegCloseKey function to close it.

Return Values

ERROR_SUCCESS indicates success. A nonzero error code defined in Winerror.h indicates failure. To get a generic description of the error, call FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag set.

Remarks

Unlike the CeRegCreateKeyEx function, the CeRegOpenKeyEx function does not create the specified key if the key does not exist in the registry.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Rapi.h.
Link Library: Rapi.lib.

See Also

RAPI Functions | CeRegCreateKeyEx (RAPI) | CeRegDeleteKey (RAPI) | FormatMessage

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.