title: CListCtrl is not creating groups
body: <p>I am trying to make groupings using a CListCtrl trough the following code:</p>
  
  <pre><code>        LVGROUP lg = { 0 };
          lg.cbSize = sizeof(lg);
  
          lg.state = LVGS_NORMAL | LVGS_COLLAPSIBLE;
          lg.mask = LVGF_GROUPID | LVGF_HEADER | LVGF_STATE | LVGF_ALIGN | LVGF_STATE | LVGF_DESCRIPTIONTOP | LVGF_DESCRIPTIONBOTTOM | LVGF_FOOTER | LVGF_TASK | LVGF_SUBTITLE | LVGF_SUBSET;
          lg.uAlign = LVGA_HEADER_LEFT | LVGA_FOOTER_RIGHT;
  
  
          LVITEM item = { 0 };
          item.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_GROUPID;
          item.iSubItem = 0;
          item.state = 0;
          item.stateMask = LVIS_SELECTED;
  
          CString s;
  
          lg.iGroupId = 0;
  
          s = L"Office";
          lg.pszHeader = s.GetBuffer();
          lg.cchHeader = s.GetLength();
  
          pListCtrl-&gt;InsertGroup(lg.iGroupId, &amp;lg);
  
          item.iGroupId = 0;
  
  
  
          s = "Pen";
          item.pszText = s.GetBuffer();
          item.cchTextMax = s.GetLength();
  
          pListCtrl-&gt;InsertItem(&amp;item);
  
          s = "Pencil";
          item.pszText = s.GetBuffer();
          item.cchTextMax = s.GetLength();
  
          pListCtrl-&gt;InsertItem(&amp;item);
  
  
  
  
          lg.iGroupId = 1;
  
          s = L"Workshop";
          lg.pszHeader = s.GetBuffer();
          lg.cchHeader = s.GetLength();
  
          pListCtrl-&gt;InsertGroup(lg.iGroupId, &amp;lg);
  
  
          item.iGroupId = 1;
  
  
  
          s = "Hammer";
          item.pszText = s.GetBuffer();
          item.cchTextMax = s.GetLength();
  
          pListCtrl-&gt;InsertItem(&amp;item);
  
  
          s = "Drill";
          item.pszText = s.GetBuffer();
          item.cchTextMax = s.GetLength();
  
          pListCtrl-&gt;InsertItem(&amp;item);
  
  
          s = "Saw";
          item.pszText = s.GetBuffer();
          item.cchTextMax = s.GetLength();
  
          pListCtrl-&gt;InsertItem(&amp;item);
  </code></pre>
  
  <p>but everything is shown ungrouped</p>
  
  <p><a href="https://i.stack.imgur.com/5owsW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5owsW.png" alt="ungrouped clistctrl"></a></p>
  
  <p>How can I make the groups work as they should?</p>