I'm currently writing fiddling around with the ListView control and having a little bit of a problem with one aspect. I want to prevent a user from resizing the columns in the list view, either by dragging the column divider or by double clicking on it. So far I've figured out I need to test for the HDN_BEGINTRACK/HDN_ENDTRACK and HDN_DIVIDERDBLCLICK in a WM_NOTIFY. I can see the HDN_DIVIDERDBLCLICK message happening but cancelling it seems to be a problem...any ideas how I can do this? I have a sneaky feeling I'm either doing something really stupid or I'm missing a obvious answer!

Thanks!


Code Fragment below (hHeader refers to the header part of the listview control and the code is being tested through the WM_NOTIFY of the window proc)


==============================================

.elseif eax==hHeader

assume edi:ptr NMHDR

.if .code == HDN_DIVIDERDBLCLICK

; Whatever i put here doesnt seem to have any effect!
.else

return 0

.endif


.endif

================================================
Posted on 2002-10-03 01:46:41 by MurkyT
MurkyT,

This is what I used in WM_NOTIFY and it works just fine, if you have no other use for the header.


" " "
" " "
assume edi:ptr NMHDR
mov eax,.hwndFrom
.elseif eax==hHeader
return TRUE
.endif


Regards,

Guy
Posted on 2002-10-03 07:46:40 by Guy
Have to dig out an old thread for this, but I prevent it from resizing like this :
Posted on 2005-12-22 17:39:49 by JimmyClif