S
Slava ilyin
Hi!
Does anyone know how to get TreeNode RECT using VB.NET?
My code is below seems to be incorrected.
What is wrong?
(sorry, I'm a novice in .NET)
\\\
Private Declare Function SendMessage Lib "user32.dll" Alias
"SendMessageA" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal
wParam As Integer, ByVal lParam As IntPtr) As Integer
....
Protected Overrides Sub WndProc(ByRef m As
System.Windows.Forms.Message)
...
Case CDDS_ITEMPOSTPAINT
...
Dim cd2 As NMTVCUSTOMDRAW = m.GetLParam(GetType(NMTVCUSTOMDRAW))
Dim rc2 As RECT = New RECT
//?
rc2.Left = cd2.nmcd.dwItemSpec
Dim gc As GCHandle = GCHandle.Alloc(rc2, GCHandleType.Pinned)
Dim addr As IntPtr = gc.AddrOfPinnedObject()
SendMessage(Handle, TVM_GETITEMRECT, 1, addr)
rc2 must consist Node rect after this (?), but actually - not.
Thanks,
Slava
--
Does anyone know how to get TreeNode RECT using VB.NET?
My code is below seems to be incorrected.
What is wrong?
(sorry, I'm a novice in .NET)
\\\
Private Declare Function SendMessage Lib "user32.dll" Alias
"SendMessageA" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal
wParam As Integer, ByVal lParam As IntPtr) As Integer
....
Protected Overrides Sub WndProc(ByRef m As
System.Windows.Forms.Message)
...
Case CDDS_ITEMPOSTPAINT
...
Dim cd2 As NMTVCUSTOMDRAW = m.GetLParam(GetType(NMTVCUSTOMDRAW))
Dim rc2 As RECT = New RECT
//?
rc2.Left = cd2.nmcd.dwItemSpec
Dim gc As GCHandle = GCHandle.Alloc(rc2, GCHandleType.Pinned)
Dim addr As IntPtr = gc.AddrOfPinnedObject()
SendMessage(Handle, TVM_GETITEMRECT, 1, addr)
rc2 must consist Node rect after this (?), but actually - not.
Thanks,
Slava
--