[API]
RegCreateKeyExA
RegCreateKeyExW
Public RegCloseKey

[CODE]
Public Function RegCreateKeyEx(ByVal HKEY As Long, ByVal lpSubKey As String, ByRef phkResult As Long) As Boolean
  Dim xLong1 As Long
  If IsUnicode Then
    RegCreateKeyEx = (RegCreateKeyExW(HKEY, StrPtr(lpSubKey), 0&, "", 0&, 2&, 0&, phkResult, xLong1) = 0&)
    Else
    RegCreateKeyEx = (RegCreateKeyExA(HKEY, lpSubKey, 0&, "", 0&, 2&, 0&, phkResult, xLong1) = 0&)
    End If
  End Function
