From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/listview.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 7f51838f000..62f16359017 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -138,8 +138,10 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" +#if __WINE_COMCTL32_VERSION == 6 #include "uxtheme.h" #include "vsstyle.h" +#endif #include "shlwapi.h"
#include "wine/debug.h" @@ -420,8 +422,6 @@ typedef struct tagLISTVIEW_INFO TRACE("hwndSelf=%p, rcList=%s\n", iP->hwndSelf, wine_dbgstr_rect(&iP->rcList)); \ } while(0)
-static const WCHAR themeClass[] = L"ListView"; - enum key_state { SHIFT_KEY = 0x1, @@ -8559,6 +8559,7 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx) * Creates the checkbox imagelist. Helper for LISTVIEW_SetExtendedListViewStyle * */ +#if __WINE_COMCTL32_VERSION == 6 static HIMAGELIST LISTVIEW_CreateThemedCheckBoxImageList(const LISTVIEW_INFO *info) { HBITMAP bitmap, old_bitmap; @@ -8600,6 +8601,7 @@ static HIMAGELIST LISTVIEW_CreateThemedCheckBoxImageList(const LISTVIEW_INFO *in CloseThemeData(theme); return image_list; } +#endif /* __WINE_COMCTL32_VERSION == 6 */
static HIMAGELIST LISTVIEW_CreateCheckBoxIL(const LISTVIEW_INFO *infoPtr) { @@ -8609,9 +8611,11 @@ static HIMAGELIST LISTVIEW_CreateCheckBoxIL(const LISTVIEW_INFO *infoPtr) HBRUSH hbr_white, hbr_black; HIMAGELIST himl;
+#if __WINE_COMCTL32_VERSION == 6 himl = LISTVIEW_CreateThemedCheckBoxImageList(infoPtr); if (himl) return himl; +#endif
hbr_white = GetStockObject(WHITE_BRUSH); hbr_black = GetStockObject(BLACK_BRUSH); @@ -9468,6 +9472,7 @@ static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare, return TRUE; }
+#if __WINE_COMCTL32_VERSION == 6 /*** * DESCRIPTION: * Update theme handle after a theme change. @@ -9483,10 +9488,11 @@ static LRESULT LISTVIEW_ThemeChanged(const LISTVIEW_INFO *infoPtr) { HTHEME theme = GetWindowTheme(infoPtr->hwndSelf); CloseThemeData(theme); - OpenThemeData(infoPtr->hwndSelf, themeClass); + OpenThemeData(infoPtr->hwndSelf, L"ListView"); InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); return 0; } +#endif
/*** * DESCRIPTION: @@ -9711,7 +9717,9 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) if (infoPtr->dwStyle & LVS_OWNERDRAWFIXED) notify_measureitem(infoPtr); }
- OpenThemeData(hwnd, themeClass); +#if __WINE_COMCTL32_VERSION == 6 + OpenThemeData(hwnd, L"ListView"); +#endif
/* initialize the icon sizes */ set_icon_size(&infoPtr->iconSize, infoPtr->himlNormal, infoPtr->uView != LV_VIEW_ICON); @@ -9732,8 +9740,10 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) */ static LRESULT LISTVIEW_Destroy(LISTVIEW_INFO *infoPtr) { +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme(infoPtr->hwndSelf); CloseThemeData(theme); +#endif
/* delete all items */ LISTVIEW_DeleteAllItems(infoPtr, TRUE); @@ -10734,6 +10744,7 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, NMHDR *lpnmhdr) return 0; }
+#if __WINE_COMCTL32_VERSION == 6 /*** * DESCRIPTION: * Paint non-client area of control. @@ -10785,6 +10796,7 @@ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region)
return 0; } +#endif
/*** * DESCRIPTION: @@ -11889,8 +11901,10 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NCDESTROY: return LISTVIEW_NCDestroy(infoPtr);
+#if __WINE_COMCTL32_VERSION == 6 case WM_NCPAINT: return LISTVIEW_NCPaint(infoPtr, (HRGN)wParam); +#endif
case WM_NOTIFY: return LISTVIEW_Notify(infoPtr, (LPNMHDR)lParam); @@ -11936,8 +11950,11 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return 0;
/* case WM_TIMER: */ + +#if __WINE_COMCTL32_VERSION == 6 case WM_THEMECHANGED: return LISTVIEW_ThemeChanged(infoPtr); +#endif
case WM_VSCROLL: return LISTVIEW_VScroll(infoPtr, (INT)LOWORD(wParam), 0);