Result = RegOpenKey(hKey, strPath, hCurKey) : : lDataBufferSize = 4 '4 bytes = 32 bits = long : : lRegResult = RegQueryValueEx(hCurKey, strValue, 0&, lValueType, lBuffer, lDataBufferSize) : : If lRegResult = ERROR_SUCCESS Then : : If lValueType = REG_DWORD Then : : GetRegLong = lBuffer : : End If : : Else : : 'there is a problem : : End If : : lRegResult = RegCloseKey(hCurKey) : : End Function : :