DWORD type = 0; DWORD size = sizeof(DWORD); DWORD result = 0;  LONG res = RegQueryValueEx(vbKey, key, NULL, &type, (UCHAR *)&result, &size);  if(res == ERROR_SUCCESS && type == REG_DWORD) return result;
if(regEnabled || force) { DWORD type = 0; DWORD size = sizeof(DWORD); DWORD result = 0;  LONG res = RegQueryValueEx(vbKey, key, NULL, &type, (UCHAR *)&result, &size);  if(res == ERROR_SUCCESS && type == REG_DWORD) return result;
DWORD regQueryDwordValue(char * key, DWORD def){  DWORD type = 0;  DWORD size = sizeof(DWORD);  DWORD result = 0;    LONG res = RegQueryValueEx(vbKey,                             key,                             NULL,                             &type,                             (UCHAR *)&result,                             &size);    if(res == ERROR_SUCCESS && type == REG_DWORD)    return result;  return def;}