PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Creating a key
  • 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
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(<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.
<Key Path>: Character string (with quotes)
Full path of key to create.
Windows Mobile This path can contain up to 255 characters and up to 16 levels.
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).
Windows Mobile

Equivalence

The operating mode of RegistryCreateKey is equivalent to the operating mode of ceRegistryCreateKey.
The only difference is:
  • RegistryCreateKey handles the Mobile Device registry (Pocket PC) from a WINDEV Mobile application.
  • ceRegistryCreateKey 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), RegistryCreateKey handles the registry of development computer.
At run time, RegistryCreateKey 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.
Component : wd240std.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
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
Nov. 27 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
Mar. 27 2016