From 90c7bc237c9cf964c16f0cb48c308a92a8193a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 2 Sep 2022 02:11:49 +0200 Subject: Use global Window object. This makes it easier to control initialization and maintain RAII. --- c/listview.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'c/listview.h') diff --git a/c/listview.h b/c/listview.h index b0e49ee..30164f7 100644 --- a/c/listview.h +++ b/c/listview.h @@ -4,11 +4,14 @@ #include #include +struct Window; + struct ListView { HWND hWnd; + Window& parent; - ListView(HWND hWndParent, HMENU hMenu, DWORD dwStyle); + ListView(Window& parent, HMENU hMenu, DWORD dwStyle); /* Retrieve next matching list view item. */ bool FindNextItem(LVITEM* lvi, LPARAM lParam); /* Naively calculate height appropriate for number of items. */ @@ -21,7 +24,6 @@ struct ListView virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); protected: WNDPROC m_proc0; - HWND m_hWndParent; }; inline bool ListView::FindNextItem(LVITEM* const lvi, const LPARAM lParam) -- cgit v1.2.3