|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| Yes
| Win32s
| Yes
| Import Library
| advapi32.lib
| Header File
| winreg.h
| Unicode
| No
| Platform Notes
| None
|
|
|
RegCloseKey
The RegCloseKey function releases the handle of the specified key.
LONG RegCloseKey(
HKEY hKey
| // handle of key to close
| );
|
|
Parameters
hKey
Identifies the open key to close.
Return Values
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a nonzero error code defined in
WINERROR.H. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic
description of the error.
Remarks
The handle for a specified key should not be used after it has been closed,
because it will no longer be valid. Key handles should not be left open any
longer than necessary.
The RegCloseKey function does not necessarily write information to the registry before
returning; it can take as much as several seconds for the cache to be flushed to the
hard disk. If an application must explicitly write registry information to the
hard disk, it can use the RegFlushKey function. RegFlushKey, however, uses many system resources and should be called only when
necessary.
See Also
RegCreateKey, RegCreateKeyEx, RegDeleteKey, RegFlushKey, RegOpenKey, RegOpenKeyEx, RegSetValue, RegSetValueEx
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
More Online Helps
Win32 Programmer's Reference (win32.hlp)
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|