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
  • Limitations of the RegistryQueryValue function
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
Reads a value in the Windows registry.
// Reads the "Language" value in the "HKEY_LOCAL_MACHINE\SOFTWARE\App" key
// ResExecute is a boolean used to find out whether the value was read
ResRead = RegistryQueryValue("HKEY_LOCAL_MACHINE\SOFTWARE\App", "Language", ResExecute)

IF ResExecute = True THEN
	Info("The value has been read and is: " + ResRead)
END
Sintaxis

Reading a value identified by its name Ocultar los detalles

<Result> = RegistryQueryValue([<Access mode>, ] <Key path> , <Value name> [, <Execution>])
<Result>: Character string, integer, real or pointer
  • Value read,
  • Empty string ("") if no value was read.
<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 read.
<Value name>: Character string
Name of value to read.
<Execution>: Optional boolean
  • True if the value was read,
  • False otherwise.

Reading a value identified by its index Ocultar los detalles

<Result> = RegistryQueryValue([<Access mode>, ] <Key path> , <Value index> , <Execution>)
<Result>: Character string, integer, real or pointer
  • Value read,
  • Empty string ("") if no value was read.
<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 read.
<Value index>: Integer
Index of the value to be read.
<Execution>: Boolean
  • True if the value was read,
  • False otherwise.
Observaciones

Limitations of the RegistryQueryValue function

RegistryQueryValue has no effect on "(default)" entries. These are specific entries. To reach these entries, the name of the key must be replaced with an empty string.
Example:
Don't:
RegistryQueryValue("HKEY_CLASSES_ROOT\.jar", "(by default)", "myfile")
Do:
RegistryQueryValue("HKEY_CLASSES_ROOT\.jar", "", "myfile")
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
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 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
28 03 2016

Última modificación: 27/03/2025

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