Private Sub Command2_Click()
Dim hwndtv As Long
Dim hhitem As Long
hwndtv = 262770 'treeiew的句柄
hhitem = 1343200 '根结点的句柄
Dim tvi As TVITEM
Dim abText(MAX_TVITEMTEXT) As Byte
tvi.mask = TVIF_TEXT
tvi.hItem = hhitem
tvi.cchTextMax = MAX_TVITEMTEXT
tvi.pszText = VarPtr(abText(0))
If TreeView_GetItem(hwndtv, tvi) Then'问题是在这儿???
MsgBox ("yes")
End If
End SubPublic Type TVITEM ' was TV_ITEM
mask As TVITEM_mask
hItem As Long
state As TVITEM_state
stateMask As Long
pszText As Long ' pointer
cchTextMax As Long
iImage As Long
iSelectedImage As Long
cChildren As Long
lParam As Long
End TypePublic Function TreeView_GetItem(hwnd As Long, pitem As TVITEM) As Boolean
TreeView_GetItem = SendMessage(hwnd, TVM_GETITEM, 0, pitem)
End Function
Dim hwndtv As Long
Dim hhitem As Long
hwndtv = 262770 'treeiew的句柄
hhitem = 1343200 '根结点的句柄
Dim tvi As TVITEM
Dim abText(MAX_TVITEMTEXT) As Byte
tvi.mask = TVIF_TEXT
tvi.hItem = hhitem
tvi.cchTextMax = MAX_TVITEMTEXT
tvi.pszText = VarPtr(abText(0))
If TreeView_GetItem(hwndtv, tvi) Then'问题是在这儿???
MsgBox ("yes")
End If
End SubPublic Type TVITEM ' was TV_ITEM
mask As TVITEM_mask
hItem As Long
state As TVITEM_state
stateMask As Long
pszText As Long ' pointer
cchTextMax As Long
iImage As Long
iSelectedImage As Long
cChildren As Long
lParam As Long
End TypePublic Function TreeView_GetItem(hwnd As Long, pitem As TVITEM) As Boolean
TreeView_GetItem = SendMessage(hwnd, TVM_GETITEM, 0, pitem)
End Function
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货