Skip to content

Commit

Permalink
make right-click->play audio always play the clicked element's audio
Browse files Browse the repository at this point in the history
  • Loading branch information
Morilli committed Jul 9, 2021
1 parent 46750ae commit 8055d71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
break;
case WM_DESTROY:
StopAudio();
RevokeDragDrop(treeview);
OleUninitialize();
PostQuitMessage(0);
Expand Down Expand Up @@ -281,9 +282,11 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
} else if ((HWND) lParam == ReplaceButton) {
ReplaceWemData(hwnd);
} else if ((HWND) lParam == PlayAudioButton) {
HTREEITEM selectedItem = (TreeView_GetSelectedCount(treeview) > 1)
HTREEITEM selectedItem = rightClickedItem
? rightClickedItem
: TreeView_GetSelection(treeview);
: TreeView_GetSelectedCount(treeview) == 1
? TreeView_GetSelection(treeview)
: NULL;
rightClickedItem = NULL;
if (selectedItem && !TreeView_IsRootItem(selectedItem)) {
TVITEM tvItem = {
Expand Down

0 comments on commit 8055d71

Please sign in to comment.