0

I have created a listview in Win32 with group view enabled, I can add Items to a group, but I Have multiple groups and I want an item to pass from group A to group B. I have found the macro ListView_MoveItemToGroup, I call it like so

int i =0;
i = m_taskList.GetSelectedIndex();

bool ret = ListView_MoveItemToGroup(m_taskList.m_hWnd,i,LVI_GROUPID_EXEC);

but ret is false; What I am doing wrong, the LVI_GROUP_EXEC is added to the litview.

fire xzanderr
  • 213
  • 2
  • 13

1 Answers1

0

The LVM_MOVEITEMTOGROUP message return TRUE if successful and FALSE otherwise, so either SendMessage() is failing, or the message itself is failing or more likely is unrecognized on your version of Windows. Use GetLastError() to differentiate between a message failure and a SendMessage() failure.

If you are not seeing the item jump between groups, you will likely have to just remove the item from the ListView first and then re-add it using the desired group.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770