aboutsummaryrefslogtreecommitdiff
path: root/c/listview.h
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-09-02 02:11:49 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-09-02 02:14:11 +0200
commit90c7bc237c9cf964c16f0cb48c308a92a8193a5c (patch)
tree53f165056dffa061a9dfe39b76913edab87056f4 /c/listview.h
parentbb9280267bfb78a8d69adea02f5ed7894833b19d (diff)
downloadEpisodeBrowser-90c7bc237c9cf964c16f0cb48c308a92a8193a5c.tar.gz
Use global Window object.
This makes it easier to control initialization and maintain RAII.
Diffstat (limited to 'c/listview.h')
-rw-r--r--c/listview.h6
1 files changed, 4 insertions, 2 deletions
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 <windows.h>
#include <commctrl.h>
+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)