https://git.reactos.org/?p=reactos.git;a=commitdiff;h=601b2532e1cc9edc6d3fa…
commit 601b2532e1cc9edc6d3fa1abda73eb0374e49039
Author:     Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Feb 24 16:56:55 2019 +0100
Commit:     Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Feb 24 16:56:55 2019 +0100
    [MMSYS] Sounds page: Update the 'Play' button and the current item in the
'Program events' treeview when a sound is selected or deselected.
---
 dll/cpl/mmsys/sounds.c | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/dll/cpl/mmsys/sounds.c b/dll/cpl/mmsys/sounds.c
index 79ee1f28a7..8b6b7d296a 100644
--- a/dll/cpl/mmsys/sounds.c
+++ b/dll/cpl/mmsys/sounds.c
@@ -1236,20 +1236,39 @@ SoundsDlgProc(HWND hwndDlg,
                             if (lResult == CB_ERR || lResult == 0)
                             {
                                 if (lIndex != pLabelContext->szValue[0])
+                                {
+                                    /* Update the tree view item image */
+                                    item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+                                    item.iImage = IMAGE_SOUND_NONE;
+                                    item.iSelectedImage = IMAGE_SOUND_NONE;
+                                    TreeView_SetItem(GetDlgItem(hwndDlg,
IDC_SCHEME_LIST), &item);
+
                                     PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+                                    EnableWindow(GetDlgItem(hwndDlg, IDC_PLAY_SOUND),
FALSE);
+                                }
+
                                 pLabelContext->szValue[0] = L'\0';
+
                                 break;
                             }
                             if (_tcsicmp(pLabelContext->szValue, (TCHAR*)lResult) ||
(lIndex != pLabelContext->szValue[0]))
                             {
+                                /* Update the tree view item image */
+                                item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+                                item.iImage = IMAGE_SOUND_ASSIGNED;
+                                item.iSelectedImage = IMAGE_SOUND_ASSIGNED;
+                                TreeView_SetItem(GetDlgItem(hwndDlg, IDC_SCHEME_LIST),
&item);
+
                                 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
-                               ///
-                               /// Should store in current member
-                               ///
-                               _tcscpy(pLabelContext->szValue, (TCHAR*)lResult);
+
+                                ///
+                                /// Should store in current member
+                                ///
+                                _tcscpy(pLabelContext->szValue, (TCHAR*)lResult);
                             }
+
                             if (_tcslen((TCHAR*)lResult) && lIndex != 0
&& pGlobalData->NumWavOut != 0)
                             {
                                 EnableWindow(GetDlgItem(hwndDlg, IDC_PLAY_SOUND), TRUE);