Microsoft.Win32.Win32RegistryApi.RegCreateKey C# (CSharp) Méthode

RegCreateKey() private méthode

private RegCreateKey ( IntPtr keyBase, string keyName, IntPtr &keyHandle ) : int
keyBase System.IntPtr
keyName string
keyHandle System.IntPtr
Résultat int
		static extern int RegCreateKey (IntPtr keyBase, string keyName, out IntPtr keyHandle);
	       

Usage Example

        public RegistryKey CreateSubKey(RegistryKey rkey, string keyName)
        {
            IntPtr handle = Win32RegistryApi.GetHandle(rkey);
            IntPtr intPtr;
            int    num = Win32RegistryApi.RegCreateKey(handle, keyName, out intPtr);

            if (num == 1018)
            {
                throw RegistryKey.CreateMarkedForDeletionException();
            }
            if (num != 0)
            {
                this.GenerateException(num);
            }
            return(new RegistryKey(intPtr, Win32RegistryApi.CombineName(rkey, keyName), true));
        }