<?php

/*******************************************************************************

 WINBINDER - The native Windows binding for PHP for PHP

 Copyright © Hypervisual - see LICENSE.TXT for details
 Author: Rubem Pechansky (http://winbinder.org/contact.php)

 Test registry functions

*******************************************************************************/

//------------------------------------------------------------ SYSTEM PARAMETERS

define("PATH_SCRIPT",	dirname(__FILE__) . "/");
define("PATH_DATA",		PATH_SCRIPT);
define("PATH_INC",		PATH_SCRIPT . "../include/");
define("PATH_RES",		PATH_SCRIPT . "../resources/");

//----------------------------------------------------------------- DEPENDENCIES

include PATH_INC . "winbinder.php";

//-------------------------------------------------------------------- CONSTANTS

// Registry funtions

$msg  = "Current wallpaper name: " . wb_get_registry_key("HKCU", "Control Panel\\Desktop", "Wallpaper") . "\n";
$msg .= "IE Local Page: " . wb_get_registry_key("HKLM", "SOFTWARE\Microsoft\Internet Explorer\Main", "Local Page") . "\n";
$msg .= "A system font: " . wb_get_registry_key("HKCC", "software/fonts", "fonts.fon") . "\n";

wb_message_box(null, $msg, null, WBC_INFO);

// Creates or sets various values

wb_set_registry_key("HKCU", "Software\\WinBinder", "String value", "1212");
wb_set_registry_key("HKCU", "Software\\WinBinder", "Integer value", 1212);
wb_set_registry_key("HKCU", "Software\\WinBinder", "Double value", 12.12);
wb_set_registry_key("HKCU", "Software\\WinBinder", "", "This is the default value");

wb_message_box(null, (float)wb_get_registry_key("HKCU", "Software\\WinBinder", "Double value"), null, WBC_INFO);

// Delete the new entries

wb_set_registry_key("HKCU", "Software\\WinBinder", "String value");
wb_set_registry_key("HKCU", "Software\\WinBinder", "Integer value");
wb_set_registry_key("HKCU", "Software\\WinBinder", "Double value");
wb_set_registry_key("HKCU", "Software\\WinBinder", null);

//-------------------------------------------------------------------------- END

?>