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/listview.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'c/listview.cpp') diff --git a/c/listview.cpp b/c/listview.cpp index 4e9d754..0f4cbc1 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -7,20 +7,19 @@ #include "main.h" extern HFONT g_hfNormal; -extern HWND g_hWnd; static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); -ListView::ListView(HMENU hMenu, DWORD dwStyle) +ListView::ListView(HWND hWndParent, HMENU hMenu, DWORD dwStyle) { + m_hWndParent = hWndParent; m_bHeader = !(dwStyle & LVS_NOCOLUMNHEADER); - m_hWnd = CreateWindowEx( WS_EX_CLIENTEDGE, WC_LISTVIEW, TEXT(""), dwStyle|WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|LVS_REPORT|LVS_SHOWSELALWAYS, 0, 0, 0, 0, - g_hWnd, hMenu, GetModuleHandle(NULL), this + m_hWndParent, hMenu, GetModuleHandle(NULL), this ); if (SetProp(m_hWnd, TEXT("this"), (HANDLE)this)) -- cgit v1.2.3