AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones del registro
  • Creating a key
  • Handling the registry in Windows Vista (and later)
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Creates a key in the Windows registry.
// Create the "HKEY_LOCAL_MACHINE\SOFTWARE\MyApp" key
ResCreateKey = RegistryCreateKey("HKEY_LOCAL_MACHINE\SOFTWARE\MyApp")
Sintaxis
<Result> = RegistryCreateKey([<Access mode>, ] <Key path>)
<Result>: Boolean
  • True if the key was created,
  • False otherwise.
If the key already exists, it is not modified: the function RegistryCreateKey returns False and variable ErrorOccurred is set to False.
<Access mode>: Integer constant
Modo de acceso al registro:
registryMode32Modo forzado para acceder al registro como un programa de 32 bits.
registryMode64Modo forzado para acceder al registro como un programa de 64 bits.
registryModeAuto
(Valor predeterminado)
Modo de acceso automático al registro:
  • una aplicación de 32 bits que se ejecuta en un sistema de 32 bits manipula el registro como un programa de 32 bits.
  • una aplicación de 32 bits que se ejecuta en un sistema de 64 bits manipula el registro desde la siguiente rama:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
  • una aplicación de 64 bits que se ejecuta en un sistema de 64 bits manipula el registro como un programa de 64 bits.
<Key path>: Character string
Full path of key to create.
Observaciones

Creating a key

  • Key creation is recursive: if the directories specified in the <Chemin de la clé> parameter 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 sufficient rights, the UAC mechanism automatically redirects to the "HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE" key. 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 an executable, you can include a manifest to give the application administrator rights.
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd300std.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Exemplo
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 11 2018
Exemplo Resgistro Windows - Ler e Gravar
//-- Global
PROCEDURE MyWindow()
gn_id_usuario is int=0
//Global declarations
_chave_senha is string="HKEY_CURRENT_USER\Software\erpmatos\"
//----------------------
//--End of

//Ler Chave
n_usuario is int=RegistryQueryValue(_chave_senha,"Usuario")
CBOX_salvar=RegistryQueryValue(_chave_senha,"Salvar")
IF CBOX_salvar=True THEN
COMBO_Usuario_matos_1=n_usuario
LSV_Usuario_matos=n_usuario
s_senha is string=RegistryQueryValue(_chave_senha,"Senha")
EDT_senha = Uncrypt(s_senha, "Password")
END
//-----------------------
//Gravar Chave
//Check box Salvar
n_usuario is int=0
IF RegistryExist(_chave_senha) = False THEN
RegistryCreateKey(_chave_senha)
END
n_usuario=COMBO_Usuario_matos_1
s_nome_usuario is string=""
RegistrySetValue(_chave_senha,"Usuario",n_usuario)
RegistrySetValue(_chave_senha,"Senha",Crypt(EDT_senha,"Password"))
HReadSeekFirst(usuario_matos,usuario_matosID,n_usuario)
IF HFound(usuario_matos) THEN
RegistrySetValue(_chave_senha,"UsuarioNome",s_nome_usuario)
ELSE
RegistrySetValue(_chave_senha,"UsuarioNome","")
END
IF CBOX_salvar=True THEN
RegistrySetValue(_chave_senha,"Salvar",1)
ELSE
RegistrySetValue(_chave_senha,"Salvar",0)
END
//--
//--Botao Salvar
IF CBOX_salvar=True THEN
n_usuario is int=0
n_usuario=COMBO_Usuario_matos_1
RegistrySetValue(_chave_senha,"Usuario",n_usuario)
RegistrySetValue(_chave_senha,"Senha",Crypt(EDT_senha,"Password"))
RegistrySetValue(_chave_senha,"UsuarioNome",gs_usuario_nome)
END

//Blog Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/03/curso-windev-registro-windows-001.html
De matos AMARILDO
27 03 2016

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local