Visual Basic - Treeview entre aplicaciones

Life is soft - evento anual de software empresarial
 
Vista:

Treeview entre aplicaciones

Publicado por Julian69 (1 intervención) el 27/07/2007 11:41:33
Necesitaria codigo que me permitiese controlar a traves de API un Control TreeView ajeno a la aplicacion donde se ejecuta, para obtener la siguiente información.

1 Saber cuantos items hay
2 Selecionar un items
3 Ver el texto del items o del subitems
4 Obtener la posicion en pantalla de un item determinado.

Tengo el siguiente codigo para obtener el texto de un item determinado sabiendo el manejador del TreeView ajeno y el de un nodo determinado pero no funciona.

Public Sub Ejemp1(TVHwnd As Long, ItemNodo As Long)

Dim tv As TV_ITEM


Dim hStr As Long, hXtr As Long
Dim hItem As Long
Dim astr As String * 1024
Dim bstr

hStr = GlobalAlloc(GMEM_FIXED, 1024)

tv.mask = TVIF_TEXT '??????
tv.hItem = ItemNodo 'Item??
tv.pszText = hStr
tv.cchTextMax = 1023

Call SendMessageRef(TVHwnd, TVM_GETITEM, 0, tv)

CopyMemory astr, hStr, 1024


bstr = Left$(astr, (InStr(astr, Chr(0)) - 1))

Debug.Print bstr
GlobalFree hStr
End Sub

Gracias de antemano
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder