Loading...
Searching...
No Matches
juce::WindowsRegistry Class Reference

## Detailed Description

Contains some static helper functions for manipulating the MS Windows registry (Only available on Windows, of course!).

The documentation for this class was generated from the following file:

- juce_core/misc/juce_WindowsRegistry.h

## Public Types

enum | WoW64Mode { WoW64_Default = 0 , WoW64_64bit = 0x100 , WoW64_32bit = 0x200 }
| These values can be used to specify whether the 32- or 64-bit registry should be used. More...

## Static Public Member Functions

static String JUCE_CALLTYPE | getValue (const String &regValuePath, const String &defaultValue=String(), WoW64Mode mode=WoW64_Default)
| Returns a string from the registry.
static uint32 JUCE_CALLTYPE | getBinaryValue (const String &regValuePath, MemoryBlock &resultData, WoW64Mode mode=WoW64_Default)
| Reads a binary block from the registry.
static bool JUCE_CALLTYPE | setValue (const String &regValuePath, const String &value, WoW64Mode mode=WoW64_Default)
| Sets a registry value as a string.
static bool JUCE_CALLTYPE | setValue (const String &regValuePath, uint32 value, WoW64Mode mode=WoW64_Default)
| Sets a registry value as a DWORD.
static bool JUCE_CALLTYPE | setValue (const String &regValuePath, uint64 value, WoW64Mode mode=WoW64_Default)
| Sets a registry value as a QWORD.
static bool JUCE_CALLTYPE | setValue (const String &regValuePath, const MemoryBlock &value, WoW64Mode mode=WoW64_Default)
| Sets a registry value as a binary block.
static bool JUCE_CALLTYPE | valueExists (const String &regValuePath, WoW64Mode mode=WoW64_Default)
| Returns true if the given value exists in the registry.
static bool JUCE_CALLTYPE | keyExists (const String &regKeyPath, WoW64Mode mode=WoW64_Default)
| Returns true if the given key exists in the registry.
static bool JUCE_CALLTYPE | deleteValue (const String &regValuePath, WoW64Mode mode=WoW64_Default)
| Deletes a registry value.
static bool JUCE_CALLTYPE | deleteKey (const String &regKeyPath, WoW64Mode mode=WoW64_Default)
| Deletes a registry key (which is registry-talk for 'folder').
static bool JUCE_CALLTYPE | registerFileAssociation (const String &fileExtension, const String &symbolicDescription, const String &fullDescription, const File &targetExecutable, int iconResourceNumber, bool registerForCurrentUserOnly, WoW64Mode mode=WoW64_Default)
| Creates a file association in the registry.

## Member Enums

## WoW64Mode

enum juce::WindowsRegistry::WoW64Mode

These values can be used to specify whether the 32- or 64-bit registry should be used.

When running on a 32-bit OS, there is no 64-bit registry, so the mode will be ignored.

Enumerator
WoW64_Default | Default handling: 32-bit apps will use the 32-bit registry, and 64-bit apps will use the 64-bit registry.
WoW64_64bit | Always use the 64-bit registry store. (KEY_WOW64_64KEY).
WoW64_32bit | Always use the 32-bit registry store. (KEY_WOW64_32KEY).

## Member Functions

## getValue()

String JUCE_CALLTYPE juce::WindowsRegistry::getValue | ( | const String & | regValuePath,
|  | const String & | defaultValue = String(),
|  | WoW64Mode | mode = WoW64_Default )

static

Returns a string from the registry.

The path is a string for the entire path of a value in the registry, e.g. "HKEY_CURRENT_USER\Software\foo\bar"

References JUCE_CALLTYPE, and WoW64_Default.

## getBinaryValue()

uint32 JUCE_CALLTYPE juce::WindowsRegistry::getBinaryValue | ( | const String & | regValuePath,
|  | MemoryBlock & | resultData,
|  | WoW64Mode | mode = WoW64_Default )

static

Reads a binary block from the registry.

The path is a string for the entire path of a value in the registry, e.g. "HKEY_CURRENT_USER\Software\foo\bar"

Returns
  a DWORD indicating the type of the key.

References JUCE_CALLTYPE, and WoW64_Default.

## setValue() [1/4]

bool JUCE_CALLTYPE juce::WindowsRegistry::setValue | ( | const String & | regValuePath,
|  | const String & | value,
|  | WoW64Mode | mode = WoW64_Default )

static

Sets a registry value as a string.

This will take care of creating any groups needed to get to the given registry value.

References JUCE_CALLTYPE, and WoW64_Default.

## setValue() [2/4]

bool JUCE_CALLTYPE juce::WindowsRegistry::setValue | ( | const String & | regValuePath,
|  | uint32 | value,
|  | WoW64Mode | mode = WoW64_Default )

static

Sets a registry value as a DWORD.

This will take care of creating any groups needed to get to the given registry value.

References JUCE_CALLTYPE, and WoW64_Default.

## setValue() [3/4]

bool JUCE_CALLTYPE juce::WindowsRegistry::setValue | ( | const String & | regValuePath,
|  | uint64 | value,
|  | WoW64Mode | mode = WoW64_Default )

static

Sets a registry value as a QWORD.

This will take care of creating any groups needed to get to the given registry value.

References JUCE_CALLTYPE, and WoW64_Default.

## setValue() [4/4]

bool JUCE_CALLTYPE juce::WindowsRegistry::setValue | ( | const String & | regValuePath,
|  | const MemoryBlock & | value,
|  | WoW64Mode | mode = WoW64_Default )

static

Sets a registry value as a binary block.

This will take care of creating any groups needed to get to the given registry value.

References JUCE_CALLTYPE, and WoW64_Default.

## valueExists()

bool JUCE_CALLTYPE juce::WindowsRegistry::valueExists | ( | const String & | regValuePath,
|  | WoW64Mode | mode = WoW64_Default )

static

Returns true if the given value exists in the registry.

References JUCE_CALLTYPE, and WoW64_Default.

## keyExists()

bool JUCE_CALLTYPE juce::WindowsRegistry::keyExists | ( | const String & | regKeyPath,
|  | WoW64Mode | mode = WoW64_Default )

static

Returns true if the given key exists in the registry.

References JUCE_CALLTYPE, and WoW64_Default.

## deleteValue()

bool JUCE_CALLTYPE juce::WindowsRegistry::deleteValue | ( | const String & | regValuePath,
|  | WoW64Mode | mode = WoW64_Default )

static

Deletes a registry value.

References JUCE_CALLTYPE, and WoW64_Default.

## deleteKey()

bool JUCE_CALLTYPE juce::WindowsRegistry::deleteKey | ( | const String & | regKeyPath,
|  | WoW64Mode | mode = WoW64_Default )

static

Deletes a registry key (which is registry-talk for 'folder').

References JUCE_CALLTYPE, and WoW64_Default.

## registerFileAssociation()

bool JUCE_CALLTYPE juce::WindowsRegistry::registerFileAssociation | ( | const String & | fileExtension,
|  | const String & | symbolicDescription,
|  | const String & | fullDescription,
|  | const File & | targetExecutable,
|  | int | iconResourceNumber,
|  | bool | registerForCurrentUserOnly,
|  | WoW64Mode | mode = WoW64_Default )

static

Creates a file association in the registry.

This lets you set the executable that should be launched by a given file extension.

Parameters

  fileExtension | the file extension to associate, including the initial dot, e.g. ".txt"
  symbolicDescription | a space-free short token to identify the file type
  fullDescription | a human-readable description of the file type
  targetExecutable | the executable that should be launched
  iconResourceNumber | the icon that gets displayed for the file type will be found by looking up this resource number in the executable. Pass 0 here to not use an icon
  registerForCurrentUserOnly | if false, this will try to register the association for all users (you might not have permission to do this unless running in an installer). If true, it will register the association in HKEY_CURRENT_USER.
  mode | the WoW64 mode to use for choosing the database

References JUCE_CALLTYPE, and WoW64_Default.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited