regGetDWORD function

int regGetDWORD(
  1. int hkey,
  2. String subKey,
  3. String valueName, {
  4. int accessRights = KEY_QUERY_VALUE,
})

Reads a DWORD from the registry.

A WindowsException is thrown the call falls.

Implementation

int regGetDWORD(
  int hkey,
  String subKey,
  String valueName, {
  int accessRights = KEY_QUERY_VALUE,
}) {
  late final int value;

  final pResult = _regGetValue(
    hkey,
    subKey,
    valueName,
    accessRights: accessRights,
    flags: RRF_RT_DWORD,
  );
  try {
    value = pResult.toDWORD();
  } finally {
    pResult.free();
  }
  return value;
}