PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Limits of RegistryQueryValue
  • 32-bit application operating on a 64-bit system
  • Equivalence
  • Operating mode in GO mode and at run time
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Reads the value of a register 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 was read and it is set to: " + ResRead)
END
Syntax

Reading a value identified by its name Hide the details

<Result> = RegistryQueryValue(<Key Path> , <Value Name> [, <Runtime>])
<Result>: Character string, integer, real or pointer
  • Value read,
  • Empty string ("") if no value was read.
<Key Path>: Character string (with quotes)
Full path of key to read.
Windows Mobile This path can contain up to 255 characters and up to 16 levels.
<Value Name>: Character string (with quotes)
Name of value to read.
<Runtime>: Optional boolean
  • True if the value was read,
  • False otherwise.

Reading a value identified by its subscript Hide the details

<Result> = RegistryQueryValue(<Key Path> , <Value Subscript> , <Runtime>)
<Result>: Character string, integer, real or pointer
  • Value read,
  • Empty string ("") if no value was read.
<Key Path>: Character string (with quotes)
Full path of key to read.
Windows Mobile This path can contain up to 255 characters and up to 16 levels.
<Value Subscript>: Integer
Subscript of value to read.
<Runtime>: Boolean
  • True if the value was read,
  • False otherwise.
Remarks

Limits of RegistryQueryValue

RegistryQueryValue does not operate on the "(by default)" entries. Indeed, these entries are specific entries. To reach these entries, the name of the key must be replaced by an empty string.
Example:
Don't:
RegistryQueryValue("HKEY_CLASSES_ROOT\.jar", "(by default)", "myfile")
Do:
RegistryQueryValue("HKEY_CLASSES_ROOT\.jar", "", "myfile")
WINDEVWEBDEV - Server codeReports and QueriesWindowsUser code (UMC)

32-bit application operating on a 64-bit system

On a 64-bit system, the 32-bit applications write into the registry from the following branch:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
Windows Mobile

Equivalence

The operating mode of RegistryQueryValue is equivalent to the operating mode of ceRegistryQueryValue.
The only difference is:
  • RegistryQueryValue handles the Mobile Device registry (Pocket PC) from a WINDEV Mobile application.
  • ceRegistryQueryValue handles the Mobile Device registry (Pocket PC) from a WINDEV application.
Windows Mobile

Operating mode in GO mode and at run time

In GO mode (simulation on the development computer), RegistryQueryValue handles the registry of development computer.
At run time, RegistryQueryValue handles the Mobile Device registry (Pocket PC).
The differences between GO mode (simulator) and real use are presented in Differences between GO mode and real use.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
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
Mar. 28 2016