Prevent Header Sizing in a List Icon Gadget

Share your advanced PureBasic knowledge/code with the community.
michaeled314
Enthusiast
Enthusiast
Posts: 340
Joined: Tue Apr 24, 2007 11:14 pm

Prevent Header Sizing in a List Icon Gadget

Post by michaeled314 »

Took me half an hour to find a way to implement this for my program... For those of you who think it cannot be done....

Code: Select all

Procedure WinCallback(hwnd, msg, wparam, lparam)
  
  result = #PB_ProcessPureBasicEvents
  
  Select msg
    Case #WM_NOTIFY
      *customdraw.NMHEADER = lparam
      Select *customdraw\hdr\code
        Case #HDN_ITEMCHANGING
          Select GetParent_(*customdraw\hdr\hwndFrom)
            Case GadgetID(your gadget pbid)
                result = #True
                ;SendMessage_(GadgetID(your gadget pbid),#LVM_SETCOLUMNWIDTH,*customdraw\iItem,#LVSCW_AUTOSIZE)
          EndSelect
      EndSelect
  EndSelect

  ProcedureReturn result
EndProcedure