Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: get grab SysTreeView32 Selected Item Text
Any thoughts
if so you can try this fuction , use the ctrl mngr extender to get the treeview handle.
;------------------------------------------------------------------------------; ;TreeGetSelectedItem : Retrieves the selected item text. ; ;Guido 12/02 ; ;------------------------------------------------------------------------------; ;htree : treeview handle ; ;------------------------------------------------------------------------------; ;Returns : Selected item. If the item is a child item returns a tab delimited ; ; list representing the item hierarchy. ; ;Note : The max item text is set to 500 , change it for bigger item text. ; ;------------------------------------------------------------------------------; #definefunction TreeGetSelectedItem(htree) user32=strcat(dirwindows(1),"user32.dll") TVM_GETNEXTITEM=4352+10 TVM_GETITEM=4352+12 TVGN_CARET=9 TVGN_PARENT=3 TVIF_HANDLE=16 TVIF_TEXT=1 MAXTEXT=500 ;change this for bigger text hitem=dllcall(user32,long:"SendMessageA",long:htree,long:TVM_GETNEXTITEM,long:TVGN_CARET,long:0) if hitem TVITEM=binaryalloc(40) mask=TVIF_TEXT|TVIF_HANDLE binarypoke4(TVITEM,0,mask) ;mask binarypoke4(TVITEM,4,hitem);hItem bufsize=MAXTEXT+1 textbuf=binaryalloc(bufsize) binarypoke4(TVITEM,16,intcontrol(42,textbuf,0,0,0)) ;pszText binarypoke4(TVITEM,20,MAXTEXT) ;cchTextMax dllcall(user32,long:"SendMessageA",long:htree,long:TVM_GETITEM,long:0,lpbinary:TVITEM) binaryeodset(textbuf,bufsize) item=binarypeekstr(textbuf,0,bufsize) ;selected item ;search for parent items while hitem !=0 hitem=dllcall(user32,long:"SendMessageA",long:htree,long:TVM_GETNEXTITEM,long:TVGN_PARENT,long:hitem) if hitem binarypoke4(TVITEM,4,hitem) ;hItem dllcall(user32,long:"SendMessageA",long:htree,long:TVM_GETITEM,long:0,lpbinary:TVITEM) item=iteminsert(binarypeekstr(textbuf,0,bufsize),0,item,@tab) endif endwhile binaryfree(TVITEM) binaryfree(textbuf) return item else return "" endif #endfunction
Article ID: W15397
File Created: 2003:05:13:11:27:28
Last Updated: 2003:05:13:11:27:28