WD Registry Windows - Regedit - Manipulando o Registro do Windows
// ----------------------------------------------------------------
// --------------------- VARIABLES USED ----------------------
// ----------------------------------------------------------------
sRegistryPath is string // path proposed in the registry
// ----------------------------------------------------------------
// ----------------------- RUN CODE ---------------------------
// ----------------------------------------------------------------
// Retrieve the path proposed by WINDEV in the registry
sRegistryPath = ProjectInfo(piRegistry)
// Display the information to the user
Info("Path proposed in the registry: "+sRegistryPath)
//---------------------------------------------------------------------------------------
// ----------------------------------------------------------------
// --------------------- VARIABLES USED ----------------------
// ----------------------------------------------------------------
sRegistryPath is string // path proposed in the registry
// ----------------------------------------------------------------
// ----------------------- RUN CODE ---------------------------
// ----------------------------------------------------------------
// Retrieve the path proposed by WINDEV in the registry
sRegistryPath = ProjectInfo(piRegistry)
// Create a "test" key
RegistryCreateKey(sRegistryPath+"\Test")
// Check the operation
IF ErrorOccurred THEN
Error("An error occurred while creating the ""Test"" key",ErrorInfo())
RETURN
END
// Display the information to the user
Info("The key: "+sRegistryPath+"\Test"+" was successfully created in registry")
//--------------------------------------------------------------------------------------------------
// ----------------------------------------------------------------
// --------------------- VARIABLES USED ----------------------
// ----------------------------------------------------------------
sRegistryPath is string // path proposed in the registry
// ----------------------------------------------------------------
// ----------------------- RUN CODE ---------------------------
// ----------------------------------------------------------------
// Retrieve the path proposed by WINDEV in the registry
sRegistryPath = ProjectInfo(piRegistry)+"\Test"
// Write the "my test" value in "string variable" into the "Test" key
RegistrySetValue(sRegistryPath,"string variable","my test")
// Check the operation
IF ErrorOccurred THEN
Error("An error occurred while writing into the value",ErrorInfo())
RETURN
END
// Display the information to the user
Info("The ""My test"" value"+" was created in the ""Test"" key value :"" "+sRegistryPath+""" of the registry")
//------------------------------------------------------------------------------------------
// ----------------------------------------------------------------
// --------------------- VARIABLES USED ----------------------
// ----------------------------------------------------------------
sRegistryPath is string // path proposed in the registry
sValueRead is string // value read in the registry
bReadTest is boolean // Check the read operation
// ----------------------------------------------------------------
// ----------------------- RUN CODE ---------------------------
// ----------------------------------------------------------------
// Retrieve the path proposed by WINDEV in the registry
sRegistryPath = ProjectInfo(piRegistry)+"\Test"
// Write the "my test" value in "string variable" into the "Test" key
sValueRead = RegistryQueryValue(sRegistryPath,"string variable",bReadTest)
// Check the operation
IF ErrorOccurred THEN
Error("An error occurred while reading the value",ErrorInfo())
RETURN
END
IF bReadTest THEN
// Display the information to the user
Info("Value read is: "+sValueRead)
ELSE
// The read operation was not performed
Info("The value was not read","(check whether the key exists)")
END
//-------------------------------------------------------------------------------------
// ----------------------------------------------------------------
// --------------------- VARIABLES USED ----------------------
// ----------------------------------------------------------------
sRegistryPath is string // path proposed in the registry
// ----------------------------------------------------------------
// ----------------------- RUN CODE ---------------------------
// ----------------------------------------------------------------
// Retrieve the path proposed by WINDEV in the registry
sRegistryPath = ProjectInfo(piRegistry)
// Delete a "test" key
RegistryDeleteKey(sRegistryPath+"\Test")
// Check the operation
IF ErrorOccurred THEN
Error("An error occurred while deleting the ""Test"" key",ErrorInfo())
RETURN
END
// Display the information to the user
Info("The key: "+sRegistryPath+"\Test"+1+" has been deleted from the registry or not found")