Click here to Skip to main content
15,887,596 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralTreeview adds nodes to itself without apparent cause Pin
cnurse14-Jan-04 21:51
cnurse14-Jan-04 21:51 
GeneralMore info...another case which causes the tree to duplicate Pin
cnurse14-Jan-04 23:24
cnurse14-Jan-04 23:24 
GeneralRe: More info...another case which causes the tree to duplicate Pin
Guillermo Rivero15-Jan-04 1:59
Guillermo Rivero15-Jan-04 1:59 
GeneralRe: More info...another case which causes the tree to duplicate Pin
cnurse15-Jan-04 2:26
cnurse15-Jan-04 2:26 
Generalformatting date to a RTF Pin
R. Thomas14-Jan-04 15:57
R. Thomas14-Jan-04 15:57 
GeneralRe: formatting date to a RTF Pin
Niels Penneman16-Jan-04 6:14
Niels Penneman16-Jan-04 6:14 
GeneralConverting a bitmap to an array of pixels Pin
elchip14-Jan-04 11:06
elchip14-Jan-04 11:06 
GeneralWM_NOTIFY Reports incorrect values Pin
Knight Lore14-Jan-04 7:46
Knight Lore14-Jan-04 7:46 
Im new to vb.net and Im trying to move mi apliccations to the new language...and i have the following problem.

Im trying to intercept the ListView messages because i want a LV footer to autoresize when a column resize.
I create a Class inherit a LV and override the WndProc sub. But when i try to intercept the WM_NOTIFY message, the asociated code seems incorrect.

Here is my code (the class):

-----------------------------------------------------------------------------
Public Class MyListView
Inherits System.Windows.Forms.ListView

Structure NMHDR
Dim hwndFrom As Long ' Window handle of control sending message
Dim idFrom As Long ' Identifier of control sending message
Dim code As Long ' Specifies the notification code
End Structure

Structure NMHEADER
Dim hdr As NMHDR
Dim iItem As Long
Dim iButton As Long
Dim lPtrHDItem As Long ' HDITEM FAR* pItem
End Structure

Public Const WM_NOTIFY = &H4E
Public Const WM_PAINT = &HF
Public Const WM_USER = &H400
Public Const WM_REFLECT = WM_USER + &H1C00
Const HDN_FIRST As Long = -300&
Const HDN_LAST As Long = -399&
Const HDN_GETDISPINFO As Long = (HDN_FIRST - 9)
Const HDN_BEGINDRAG As Long = (HDN_FIRST - 10)
Const HDN_ENDDRAG As Long = (HDN_FIRST - 11)
Const HDN_ITEMCLICK As Long = (HDN_FIRST - 2)
Const HDN_ITEMDBLCLICK As Long = (HDN_FIRST - 3)
Const HDN_DIVIDERDBLCLICK As Long = (HDN_FIRST - 5)
Const HDN_ITEMCHANGING As Long = (HDN_FIRST - 0)
Const HDN_ITEMCHANGED As Long = (HDN_FIRST - 1)
Const HDN_BEGINTRACK As Long = (HDN_FIRST - 6)
Const HDN_ENDTRACK As Long = (HDN_FIRST - 7)
Const HDN_TRACK As Long = (HDN_FIRST - 8)
Const NM_FIRST As Long = -0& ' (0U- 0U)
Const NM_CUSTOMDRAW As Long = (NM_FIRST - 12)
Const NM_RCLICK As Long = (NM_FIRST - 5)
Const NM_RELEASEDCAPTURE As Long = (NM_FIRST - 16)
Const NM_CLICK As Long = NM_FIRST - 2
Const LVN_FIRST As Long = 100
Const LVN_COLUMNCLICK As Long = LVN_FIRST - 8

Protected Overrides Sub WndProc(ByRef m As Message)
Dim nmh As NMHDR

Select Case m.Msg

Case WM_NOTIFY
nmh = CType(m.GetLParam(nmh.GetType), NMHDR)
If nmh.code = HDN_BEGINTRACK Then
MsgBox("track")
End If

End Select

MyBase.WndProc(m)

End Sub

End Class
'-----------------------------------------------------------------------------

The WM_NOTIFY is detected OK. But I cant get the HDN_BEGINTRACK code. Instead, I get some stranges values
like 5334658619277312 or 5334486820585472

Please HELP!

Thanks in advance.

GeneralRe: WM_NOTIFY Reports incorrect values Pin
Niels Penneman14-Jan-04 9:39
Niels Penneman14-Jan-04 9:39 
GeneralRe: WM_NOTIFY Reports incorrect values Pin
Knight Lore15-Jan-04 4:07
Knight Lore15-Jan-04 4:07 
GeneralRe: WM_NOTIFY Reports incorrect values Pin
Niels Penneman15-Jan-04 6:19
Niels Penneman15-Jan-04 6:19 
GeneralRe: WM_NOTIFY Reports incorrect values Pin
Niels Penneman15-Jan-04 6:20
Niels Penneman15-Jan-04 6:20 
GeneralCopy files from source to Destination Pin
len_ems13-Jan-04 20:19
len_ems13-Jan-04 20:19 
GeneralRe: Copy files from source to Destination Pin
Corinna John13-Jan-04 23:54
Corinna John13-Jan-04 23:54 
GeneralGet active machines Pin
radhika8113-Jan-04 18:52
radhika8113-Jan-04 18:52 
GeneralRe: Get active machines Pin
Dave Kreskowiak14-Jan-04 4:08
mveDave Kreskowiak14-Jan-04 4:08 
GeneralRe: Get active machines Pin
Anonymous16-Jan-04 18:06
Anonymous16-Jan-04 18:06 
GeneralRe: Get active machines Pin
Dave Kreskowiak17-Jan-04 3:55
mveDave Kreskowiak17-Jan-04 3:55 
Generalformatted printing BUT NOT from db Pin
R. Thomas13-Jan-04 17:45
R. Thomas13-Jan-04 17:45 
GeneralRe: formatted printing BUT NOT from db Pin
R. Thomas13-Jan-04 17:53
R. Thomas13-Jan-04 17:53 
GeneralRe: formatted printing BUT NOT from db Pin
R. Thomas13-Jan-04 18:50
R. Thomas13-Jan-04 18:50 
QuestionWhat is the code that used to convert microsoft access file to Excel file Pin
Lim Goh Tong13-Jan-04 16:54
Lim Goh Tong13-Jan-04 16:54 
GeneralEvent handling problem - unmanaged C++ COM and VB .NET interop Pin
rpins13-Jan-04 11:24
rpins13-Jan-04 11:24 
GeneralTimers(?) Pin
Stacy Springer13-Jan-04 10:54
Stacy Springer13-Jan-04 10:54 
GeneralRe: Timers(?) Pin
Dave Kreskowiak13-Jan-04 11:33
mveDave Kreskowiak13-Jan-04 11:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.