From 84c3dd3587e219caa80adc2070f0e9fe004c27bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 16 Jul 2022 01:00:20 +0200 Subject: Add m_hWndParent to ListView. This avoids g_hWnd. --- c/episodelistview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'c/episodelistview.cpp') diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index a126649..1a41986 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -13,7 +13,8 @@ extern DataListView *g_lpDlv; int CALLBACK ElvSort(LPARAM, LPARAM, LPARAM); -EpisodeListView::EpisodeListView() : ListView((HMENU)IDC_EPISODELISTVIEW, 0) +EpisodeListView::EpisodeListView(HWND hWndParent) + : ListView(hWndParent, (HMENU)IDC_EPISODELISTVIEW, 0) { LVCOLUMN lvc; @@ -129,12 +130,11 @@ LRESULT EpisodeListView::HandleNotify(LPARAM lParam) } case NM_RCLICK: { - extern HWND g_hWnd; extern HMENU g_hPopupMenu; DWORD dwPos = GetMessagePos(); TrackPopupMenu(g_hPopupMenu, TPM_RIGHTBUTTON, LOWORD(dwPos), HIWORD(dwPos), 0, - g_hWnd, NULL); + m_hWndParent, NULL); break; } } -- cgit v1.2.3