在MSDN可以看到 HDN_TRACK Notification Notifies a header control's parent window that the user is dragging a divider in the header control. This notification message is sent in the form of a WM_NOTIFY message. 这个有点复杂,当然也是要用到Subclassing先截取WM_NOTIFY消息,然后对比LPNMHEADER结构中的codeHDN_BEGINTRACKA '开始 HDN_TRACKA '调整ing HDN_ENDTRACKA '结束然后就看代码吧 Case WM_NOTIFY
HDN_TRACK Notification
Notifies a header control's parent window that the user is dragging a divider in the header control. This notification message is sent in the form of a WM_NOTIFY message. 这个有点复杂,当然也是要用到Subclassing先截取WM_NOTIFY消息,然后对比LPNMHEADER结构中的codeHDN_BEGINTRACKA '开始
HDN_TRACKA '调整ing
HDN_ENDTRACKA '结束然后就看代码吧 Case WM_NOTIFY
Call CopyMemory(uNMH, ByVal lParam, Len(uNMH))
If (uNMH.hwndFrom = m_hHeader) Then
If (m_hHeader) Then
With uHDHTI
Call GetCursorPos(.pt)
Call ScreenToClient(m_hHeader, .pt)
Call SendMessage(m_hHeader, HDM_HITTEST, 0, uHDHTI)
Select Case uNMH.code
Case HDN_TRACKA
Debug.Print "调整ing..."
更多代码可以参考
http://ww.nn.cn/sydinar/programming/uclistview.rar (40kb)