O'Reilly logo

Access 2003 VBA Programmer's Reference by Armen Stein, Graham Seach, Teresa Hennig, Patricia Cardoza

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

L.2. Registry Function Declarations

There are 30 Win32 Registry functions that you can use from VBA. This section describes only 25 of them, because the remaining 5 require specialist knowledge of Windows security, which is well beyond the scope of this book. The functions are arranged in alphabetical order and a brief description of what each function does is given. It also lists the functions declarations, and describes each of their parameters and their return values.

The following API functions are not included in this section:

  • RegDisablePredefinedCache: This API function disables the specified handle table for a process's HKEY_CURRENT_USER key.

  • RegOpenCurrentUser: This API function returns a handle to HKEY_CURRENT_USER for the user for whom the current thread is impersonating.

  • RegOpenUserClassesRoot: This API function returns a handle to HKEY_CLASSES_ROOT for the specified user.

  • RegOverrridePredefKey: This API function maps one key to another.

  • RegQueryMultipleValues: This API function returns the type and data of the values of an open key.

Some functions have been extended to provide more programming flexibility over their predecessors. Such functions are preferred in 32-bit Windows and are distinguished from the former version by a trailing Ex in their name, for example, RegCreateKeyEx.

L.2.1. RegCloseKey

DescriptionThis API function closes a registry key.
DeclarationDeclare Function RegCloseKey Lib "advapi3 2.dll" _ (ByVal hKey As Long) As Long
ParametersParameterDescription ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required