comctl32: listview: Store the iSubItem in header's lParam in LVM_INSERTCOLUMN.
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 4878778..e57e584 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -6545,6 +6545,16 @@
     
     ZeroMemory(&hdi, sizeof(HDITEMW));
     column_fill_hditem(infoPtr, &hdi, nColumn, lpColumn, isW);
+    
+    /*
+     * when the iSubItem is available Windows copies it to the header lParam. It seems
+     * to happen only in LVM_INSERTCOLUMN - not in LVM_SETCOLUMN
+     */
+    if (lpColumn->mask & LVCF_SUBITEM)
+    {
+        hdi.mask |= HDI_LPARAM;
+        hdi.lParam = lpColumn->iSubItem;
+    }
 
     /* insert item in header control */
     nNewColumn = SendMessageW(infoPtr->hwndHeader,