From 5df0484c21a85a331e915d64d687fd492d3b950c Mon Sep 17 00:00:00 2001 From: Gregor Schneider Date: Sun, 30 May 2010 15:13:04 +0000 Subject: [PATCH] [MMSYS] Load the no sound item in the shared buffer before preparing the reactos/media path for loading individual files See issue #5436 for more details. svn path=/trunk/; revision=47446 --- reactos/dll/cpl/mmsys/sounds.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/reactos/dll/cpl/mmsys/sounds.c b/reactos/dll/cpl/mmsys/sounds.c index be314e181e0..c7ff17187a5 100644 --- a/reactos/dll/cpl/mmsys/sounds.c +++ b/reactos/dll/cpl/mmsys/sounds.c @@ -718,6 +718,14 @@ LoadSoundFiles(HWND hwndDlg) LRESULT lResult; UINT length; + /* Add no sound listview item */ + if (LoadString(hApplet, IDS_NO_SOUND, szPath, MAX_PATH)) + { + szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0'; + SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST, CB_ADDSTRING, (WPARAM)0, (LPARAM)szPath); + } + + /* Load sound files */ length = GetWindowsDirectoryW(szPath, MAX_PATH); if (length == 0 || length >= MAX_PATH - 9) { @@ -736,11 +744,6 @@ LoadSoundFiles(HWND hwndDlg) { return FALSE; } - if (LoadString(hApplet, IDS_NO_SOUND, szPath, MAX_PATH)) - { - szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0'; - SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST, CB_ADDSTRING, (WPARAM)0, (LPARAM)szPath); - } do { @@ -1054,6 +1057,7 @@ SoundsDlgProc(HWND hwndDlg, ZeroMemory(&item, sizeof(LVITEM)); item.mask = LVIF_PARAM; item.iItem = nm->iItem; + if (ListView_GetItem(GetDlgItem(hwndDlg, IDC_SCHEME_LIST), &item)) { LRESULT lCount, lIndex, lResult;