ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Registry functions
  • Overview
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
Overview
Several WINDEV functions can be used to handle the Windows registry.
The registry is a file used to store indexed information (classified by keys) describing the system hardware, the user preferences and the configuration settings.
Handling the registry in Windows Vista:
In 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 performs an automatic 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.
Remark: 32-bit applications can also access the 64-bit Registry, and vice versa.
Related Examples:
Registry Unit examples (WINDEV): Registry
[ + ] Handling the Windows registry:
- Create a key
- Write a value
- Read a value
- Delete a key
- Find out the key associated with the current project
WD Evaluation period Training (WINDEV): WD Evaluation period
[ + ] This example explains how to limit the use of an application to a given period (evaluation period).
The following topics are presented in this example:
1/ the protection of an application for a given duration
2/ the management of the registry

Summary of the example supplied with WINDEV:
When this example is started for the first time, it is activated for an evaluation period set to 5 days.
The information regarding the date when it was first started is stored in the registry and a control key is used to check whether this date was not modified by the end user. At the end of the evaluation period, the application is locked, unless the end user provides the code for unlocking the application
WD Device Opening Training (WINDEV): WD Device Opening
[ + ] When inserting a removable device (USB key, and so on), the operating system of Windows proposes a list of preset actions to open the files found in this device.
The set of procedures proposed in this example will allow you to easily add or delete an application to/from the automatic opening system for the removable devices by programming.
WD Persistence Training (WINDEV): WD Persistence
[ + ] This example presents the use of InitParameter, LoadParameter and SaveParameter.
These functions are used to configure the backup of controls, variables and other parameters.
This example is divided into three parts:
- The configuration
- The manual management of variables (SaveParameter and LoadParameter)
- The optimization
1°) Configuration

The configuration window enables you to modify the location of the backup of parameters (registry, INI file, XML file) as well as its path (registry key or file path).
2°) Manual management of the variables
The manual management enables you to save the content of the variables via SaveParameter and to restore them via LoadParameter. Each parameter is identified by a name. These values are saved at the location defined in the configuration window.
3°) The optimization
This window explains how to optimize your code to avoid the slowness caused when the saved values are restored. Indeed, when restoring the value of a control, its modification code is run. If you have long processes (queries with parameters for instance), this window shows you how to speed up the loading of the window.
Minimum version required
  • Version 9
Comments
Example
PROCEDURE TaskManager(bEnableDisable is boolean)

//Buscar
ResExist1 is boolean = RegistryExist("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\")
ResExist2 is boolean = RegistryExist("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System")

//Criar se nao existe a Pasta System
IF ResExist1 = True AND ResExist2 = False THEN
//cria a pasta da esquerda
RegistryCreateKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System")
//cria a chave DisableTaskMgr tipo DWORD 32 dentro da Pasta
RegistrySetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System","DisableTaskMgr",0)
END

if bEnableDisable = false
RegistrySetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System","DisableTaskMgr",1) //disable

else

RegistrySetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System","DisableTaskMgr",0) //enable

end
BOLLER
27 Nov. 2018

Last update: 06/23/2023

Send a report | Local help