fn SetValueEx(self, value: &str, data: RegistryValue) -> WinResult<()> {
		match co::ERROR(
			unsafe {
				advapi::ffi::RegSetValueExW(
					self.as_ptr(),
					WString::from_str(value).as_ptr(),
					0,
					data.reg_type().0,
					data.as_ptr() as _,
					data.len() as _,
				)
			} as _,
		) {
			co::ERROR::SUCCESS => Ok(()),
			err => Err(err),
		}
	}
/// [`RegSetValueEx`](https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regsetvalueexw)
/// method.
///
/// If the value doesn't exist, if will be created. If new type is different
/// from current type, new type will prevail.
///
/// # Examples
///
/// ```rust,no_run
/// use winsafe::prelude::*;
/// use winsafe::{co, HKEY, RegistryValue, WString};
///
/// let hkey = HKEY::CURRENT_USER.OpenKeyEx(
///     "Console\\Git Bash",
///     co::REG_OPTION::default(),
///     co::KEY::ALL_ACCESS,
/// )?;
///
/// hkey.SetValueEx(
///     "Color",
///     RegistryValue::Sz(WString::from_str("blue")),
/// )?;
///
/// hkey.CloseKey()?;
/// # Ok::<_, co::ERROR>(())
/// ```



If the value doesn't exist, if will be created. If new type is different
from current type, new type will prevail.
If the value doesn ' t exist if will be created . If new type is different from current type new type will prevail .
fn SetValueEx(self, value: &str, data: RegistryValue) -> WinResult<()> {
		match co::ERROR(
			unsafe {
				advapi::ffi::RegSetValueExW(
					self.as_ptr(),
					WString::from_str(value).as_ptr(),
					0,
					data.reg_type().0,
					data.as_ptr() as _,
					data.len() as _,
				)
			} as _,
		) {
			co::ERROR::SUCCESS => Ok(()),
			err => Err(err),
		}
	}
fn SetValueEx ( self , value : & str , data : RegistryValue ) -> WinResult < ( ) > { match co :: ERROR ( unsafe { advapi :: ffi :: RegSetValueExW ( self . as_ptr ( ) , WString :: from_str ( value ) . as_ptr ( ) , 0 , data . reg_type ( ) . 0 , data . as_ptr ( ) as _ , data . len ( ) as _ , ) } as _ , ) { co :: ERROR :: SUCCESS => Ok ( ( ) ) , err => Err ( err ) , } }
[`RegSetValueEx`](https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regsetvalueexw)
method.
[ ` RegSetValueEx ` ] ( https : // docs . microsoft . com / en - us / windows / win32 / api / winreg / nf - winreg - regsetvalueexw ) method .
self
value
&str
data
RegistryValue
self
value
&str
data
RegistryValue
examples

```rust,no_run
use winsafe::prelude::*;
use winsafe::{co, HKEY, RegistryValue, WString}.

let hkey = HKEY::CURRENT_USER.OpenKeyEx(
"Console\\Git Bash",
co::REG_OPTION::default(),
co::KEY::ALL_ACCESS,
)?.

hkey.SetValueEx(
"Color",
RegistryValue::Sz(WString::from_str("blue")),
)?.

hkey.CloseKey()?.
` ` ` rust no_run use winsafe :: prelude :: * ; use winsafe :: { co HKEY RegistryValue WString } . let hkey = HKEY :: CURRENT_USER . OpenKeyEx ( " Console \\ Git Bash " co :: REG_OPTION :: default () co :: KEY :: ALL_ACCESS ) ? . hkey . SetValueEx ( " Color " RegistryValue :: Sz ( WString :: from_str ( " blue " )) ) ? . hkey . CloseKey () ? .
ok::<_, co::error>(())

None