ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

BOOL AddSoundProfile ( HWND  hwndDlg,
HKEY  hKey,
TCHAR szSubKey,
BOOL  SetDefault 
)

Definition at line 287 of file sounds.c.

Referenced by EnumerateSoundProfiles().

{
    HKEY hSubKey;
    TCHAR szValue[MAX_PATH];
    DWORD dwValue, dwResult;

    if (RegOpenKeyEx(hKey,
                     szSubKey,
                     0,
                     KEY_READ,
                     &hSubKey) != ERROR_SUCCESS)
    {
        return FALSE;
    }

    dwValue = sizeof(szValue) / sizeof(TCHAR);
    dwResult = RegQueryValueEx(hSubKey,
                               NULL,
                               NULL,
                               NULL,
                               (LPBYTE)szValue,
                               &dwValue);
    RegCloseKey(hSubKey);
    if (dwResult == ERROR_SUCCESS)
    {
        LRESULT lResult = SendDlgItemMessage(hwndDlg, IDC_SOUND_SCHEME, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValue);
        if (lResult != CB_ERR)
        {
            PSOUND_SCHEME_CONTEXT pScheme = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SOUND_SCHEME_CONTEXT));
            if (pScheme != NULL)
            {
                _tcscpy(pScheme->szDesc, szValue);
                _tcscpy(pScheme->szName, szSubKey);
            }

            SendDlgItemMessage(hwndDlg, IDC_SOUND_SCHEME, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)pScheme);
            if (SetDefault)
            {
                SendDlgItemMessage(hwndDlg, IDC_SOUND_SCHEME, CB_SETCURSEL, (WPARAM)lResult, (LPARAM)0);
            }
        }
        return TRUE;
    }
    return FALSE;
}

Generated on Sat May 26 2012 04:59:25 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.