- This topic has 5 replies, 2 voices, and was last updated 14 years ago by Chike.
-
AuthorPosts
-
April 25, 2010 at 11:23 pm #187238methodMember
Hi all . I wonder how i can select an item from a treeview(which is paltalk buddy list treeview) having the handle of treeview and position of item in treeview? could any one show me how i can write a CrossProcess function giving it the handle of treeview. Looking forward for replies.Thanks
April 27, 2010 at 2:58 pm #187243ChikeMemberThere is a small loop I once wrote.
http://www.imfiles.com/topic/paltalk-buddy-list/
Just replace the macros with TVM_ messages and use TVM_SELECTITEM to select the item you want.April 28, 2010 at 1:26 am #187242methodMemberThanks for you reply chike. I am trying to do this in vb6. So could you explain to me how to get value of hItem and what is it? Is it treeview item index ?Furthermore, how to get ByVal code? and what is it ? I assume hWnd is the handle of treeview right ? could you look at this code and tell me if this is the right way to do it in VB6. I already know how to get handle of treeview and total treeview item.Looking forward for your reply.
hWnd: handle of treeview
code:?
hItem:?
TreeView_Select : is it value of selected item in our case buddy name ?Const TV_FIRST = &H1100
Const TVM_SELECTITEM = (TV_FIRST + 11)
TreeView_Select = SendMessage(hWnd, TVM_SELECTITEM, ByVal code, ByVal hItem)April 28, 2010 at 3:23 am #187241ChikeMembercode: TVGN_CARET
hitem the value returned by TVM_GETNEXTITEMMay 4, 2010 at 12:53 am #187240methodMemberChick could you explain to me what TVM_GETNEXTITEM, TVGN_NEXT values are and method to get them ? Furthermore why hItem is 2 place in sendMesange ? I am just trying to learn how i could search for a name in treeview and highlight it and be happy if you explain to me the alghoritm for it.Thanks
hItem = SendMessage(hlwd, TVM_GETNEXTITEM, TVGN_NEXT, hItem)
May 5, 2010 at 3:03 pm #187239ChikeMembersame loop as in the excample with massages instead of macros.
HWND gradienttreeviewclass = FindWindowEx(atla, 0, "gradienttreeviewclass", NULL);
HTREEITEM htvitem = (HTREEITEM) //TreeView_GetRoot(gradienttreeviewclass);
SendMessage(gradienttreeviewclass, TVM_GETNEXTITEM, TVGN_ROOT, NULL);
char text[256];
while (htvitem) {
GetTVItem(gradienttreeviewclass, htvitem, text, 256);
// un-comment the '|| true' to see onffine too
if (_strnicmp("offline", text, 7) /*|| true*/) {
printf("%sn", text);
// get 1st buddy in this group
HTREEITEM htvsubitem = (HTREEITEM) //TreeView_GetChild(gradienttreeviewclass, htvitem);
SendMessage(gradienttreeviewclass, TVM_GETNEXTITEM,
TVGN_CHILD, PtrToLong(htvitem));
while (htvsubitem) {
GetTVItem(gradienttreeviewclass, htvsubitem, text, 256);
printf(" %sn", text);
// get next buddy
htvsubitem = (HTREEITEM) //TreeView_GetNextSibling(gradienttreeviewclass, htvitem1);
SendMessage(gradienttreeviewclass, TVM_GETNEXTITEM,
TVGN_NEXT, PtrToLong(htvsubitem));
}
}
// get next group
htvitem = (HTREEITEM)//TreeView_GetNextSibling (gradienttreeviewclass, htvitem);
SendMessage(gradienttreeviewclass, TVM_GETNEXTITEM,
TVGN_NEXT, PtrToLong(htvitem));
}
-
AuthorPosts
Related
- You must be logged in to reply to this topic.