I'm trying to get a header control to work with some listboxes so when the user drags a header, the listboxes (each listbox is supposed to be a column) are resized to match up with the header. So when I receive the HDN_TRACK message this is what I do:
But for some reason, no matter what lparam is in the call to SendMessage, the listbox doesn't change size.
NMHEADER* nmh = (LPNMHEADER)lParam;
If it helps, here's the declaration of the listbox in the resource script (generated by VS):
LISTBOX IDC_LIST1,0,32,300,155,LBS_SORT | LBS_NOINTEGRALHEIGHT |
NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP
Ah forget it, I used SetWindowPos instead and that seems to work fine...
You can also use MoveWindow. May I suggest a list-view?
That sounds a lot easier, thanks! :D