PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Creating a key
  • Handling the registry in Windows Vista (and later)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Creates a key in the Windows registry.
// Create the "HKEY_LOCAL_MACHINE\SOFTWARE\MyApp" key
ResCreateKey = RegistryCreateKey("HKEY_LOCAL_MACHINE\SOFTWARE\MyApp")
Syntax
<Result> = RegistryCreateKey([<Access mode>, ] <Key path>)
<Result>: Boolean
  • True if the key was created,
  • False otherwise.
The key is not modified if it already exists: RegistryCreateKey returns False and the ErrorOccurred variable is set to False.
<Access mode>: Integer constant
Versions 27 and later
Registry access mode:
registryModeAuto
(Default value)
Automatic registry access mode:
  • a 32-bit application running on a 32-bit system manipulates the registry as a 32-bit program.
  • a 32-bit application running on a 64-bit system manipulates the registry from the following branch:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
  • a 64-bit application running on a 64-bit system manipulates the registry as a 64-bit program.
registryMode32Forced mode to access the registry as a 32-bit program.
registryMode64Forced mode to access the registry as a 64-bit program.
New in version 27
Registry access mode:
registryModeAuto
(Default value)
Automatic registry access mode:
  • a 32-bit application running on a 32-bit system manipulates the registry as a 32-bit program.
  • a 32-bit application running on a 64-bit system manipulates the registry from the following branch:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
  • a 64-bit application running on a 64-bit system manipulates the registry as a 64-bit program.
registryMode32Forced mode to access the registry as a 32-bit program.
registryMode64Forced mode to access the registry as a 64-bit program.
Registry access mode:
registryModeAuto
(Default value)
Automatic registry access mode:
  • a 32-bit application running on a 32-bit system manipulates the registry as a 32-bit program.
  • a 32-bit application running on a 64-bit system manipulates the registry from the following branch:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
  • a 64-bit application running on a 64-bit system manipulates the registry as a 64-bit program.
registryMode32Forced mode to access the registry as a 32-bit program.
registryMode64Forced mode to access the registry as a 64-bit program.
<Key path>: Character string
Full path of key to create.
Remarks

Creating a key

  • The key creation is recursive: if the directories specified in <Key path> do not exist, they are automatically created in the registry.
  • Only secondary keys can be created (no primary key can be created).

Handling the registry in Windows Vista (and later)

Starting with Windows Vista, if the UAC mechanism is enabled, you must have administrator rights to write to the "HKEY_LOCAL_MACHINE\SOFTWARE" key.
If the user does not have the necessary rights, the UAC mechanism performs a redirection to "HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE". The purpose of this redirection is to ensure the compatibility of the applications. The keys written in this directory can be read by the application that has written them.
Reminder: when creating the executable, a manifest can be included in the executable so that administrator rights are granted to the application.
Business / UI classification: Business Logic
Component: wd270std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment