Opened 10 years ago

Closed 8 years ago

#9471 closed defect (fixed)


Reported by: BoozooK Owned by:
Priority: normal Milestone:
Component: wxMSW Version: 2.8.7
Keywords: Cc:
Blocked By: Blocking:
Patch: no


Hello everybody,

I don't kown if you already know it but I've found nothing about it, the EVT_LIST_COL_DRAGGING event doesn't work on the MSW port, while it works well on the GTK one. It can be seen in the listctrl sample included in wxWidgets for example.
I can still simulate the event with (BEGIN_DRAG + mouse events + END_DRAG) though.

wxWidgets is really a good library, continue the good job

Change History (4)

comment:1 Changed 10 years ago by vadz

  • Status changed from new to confirmed
  • Summary changed from [wx 2.8.7, WinXP, vc++ 9] EVT_LIST_COL_DRAGGING to No EVT_LIST_COL_DRAGGING

This is a known bug, see comment before wxEVT_COMMAND_LIST_COL_DRAGGING occurrence in src/msw/listctrl.cpp. It really looks we can't rely on HDN_TRACK being generated and need to emulate them ourselves using HDN_ITEMCHANGING...

comment:2 Changed 10 years ago by vadz

  • Owner vadz deleted
  • Status changed from confirmed to new

comment:3 Changed 8 years ago by Jeremie

I had the same issue and after some googling I found that the HDS_FULLDRAG style on the header control prevents HDN_TRACK from firing and instead fires HDN_ITEMCHANGING.

Adding the following to the ctor of my list controls fixed it:

HWND hwnd = ListView_GetHeader((HWND)GetHandle());
::SetWindowLongPtr(hwnd, GWL_STYLE, ::GetWindowLongPtr(hwnd, GWL_STYLE) & ~HDS_FULLDRAG);


comment:4 Changed 8 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [63240]) Fix sending of wxEVT_COMMAND_LIST_COL_DRAGGING events in wxMSW wxListCtrl.

We were not getting HDN_TRACK from the system because apparently it is not
sent for header controls with HDS_FULLDRAG style which is used by default by
the native list control. A possible solution would be to forcefully unset this
style but this would make the UI look old fashioned and less intuitive so
instead send these DRAGGING events from HDN_ITEMCHANGING.

Closes #9471,

Note: See TracTickets for help on using tickets.