{ // SSEdit_Extensions: // Checks if the valuename exists. Key must be opened first. p1 = valuename extension exRegistry bool regCheckExists(string); // Closes the open registry key. Good practice to call this once you're finished using the registry. extension exRegistry void regCloseKey(); // Opens a registry key or creates it if it doesn't exist. p1 = hive, p2 = keypath extension exRegistry bool regCreateKey(string, string); // Deletes the specified value in the currently open key. p1 = valuename extension exRegistry bool regDeleteValue(string); // Returns a string value from registry. Key must be opened first. p1 = valuename extension exRegistry string regGetString(string); // Sets (or creates) a string value in the registry. Key must be opened first. p1 = valuename, p2 = data to write extension exRegistry bool regSetString(string, string); } // ************************************************************************************************************ // Called once when the plugin is started. Do one time setup here. // ************************************************************************************************************ function Init() { // The purpose of this sample is to demonstrate the exRegistry Shiny extension. // This code creates a TestKey key in HKEY_CURRENT_USER\Software, then writes // a sample string to a sample value. It then reads the value back in and displays // it in the virtual machine debug window. // Create and open a sample key in HKEY_CURRENT_USER Software\TESTKEY if(regCreateKey("HKCU", "Software\\TestKey") == True) { // The key opened successfully. Check if a sample value exists if(regCheckExists("SampleVal") == True) { // Yes it does, so delete it first regDeleteValue("SampleVal"); } // Now write a string to SampleVal string MyString = "Test reg value"; regSetString("SampleVal", MyString); // We just wrote this value, but check again for completeness if(regCheckExists("SampleVal") == True) { // Now read the value back into a variable string FromReg = regGetString("SampleVal"); // Display it in the debug window print "From registry: " + FromReg; } } else { // Debug print to let us know what happened print "Couldn't create the key"; } regCloseKey(); }