setRegPath

Syntax

int setRegPath(char * path[, args...])

Arguments

path
A string specifying the path.
args
printf style arguments with FM extensions.

Return

Returns ERROR_SUCCESS if the operation was successful, otherwise it returns one of the following integer error codes:
ERROR_SUCCESS(==0) no error
ERROR_FILE_NOT_FOUNDkey or value name not found
ERROR_MORE_DATAbuffer wasn't big enough (e.g., getRegString, getRegData)
ERROR_NO_MORE_ITEMSindex >= # of values or subkeys (enumRegValue, enumRegSubKey)
ERROR_INVALID_FUNCTIONbad top-level key, etc
ERROR_INVALID_DATAwrong data type or size (or size > 2048)
ERROR_BADDBregistry database is corrupt
ERROR_BADKEYregistry key is invalid
ERROR_CANTOPENregistry key could not be opened
ERROR_CANTREADregistry key could not be read
ERROR_CANTWRITEregistry key could not be written
ERROR_REGISTRY_CORRUPTregistry is corrupt
ERROR_REGISTRY_IO_FAILEDinput/output to registry failed
ERROR_KEY_DELETEDIllegal operation attempted on a Registry key which has been marked for deletion.
ERROR_KEY_HAS_CHILDRENcannot delete a key with subkeys (Windows NT)

Description

Sets the the current registry path.

By default, FM sets the registry path to "Software\\!O\\!C\\!t", which will expand to "Software\\<Organization>\\<Filter-category>\\<Filter-title>", as recommended by Microsoft.

Example

// Sets the registry key and path back to the FM default values.
setRegRoot(HKEY_CURRENT_USER);
setRegPath("Software\\!O\\!C\\!t");

See Also

getRegPath, setRegRoot

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.