翻阅了一些资料,都找不到合适的答案,只好求助于CSDN的众多大牛们了。大致代码如下:IntPtr treeViewHandler; // 另外一个进程中的Treeview的句柄TVITEM treeViewItem;     // Treeview Item struct// 得到当前被选中的节点的下一个节点的句柄
IntPtr Test1 = SendMessage(treeViewHandler, TVM_GETNEXTITEM, TVGN_NEXT, treeViewItem.hItem);     // treeViewItem.hItem 是当前被选中的节点的句柄// 向这个节点发送TVM_SELECTITEM消息选中这个节点
IntPtr Test2 = SendMessage(treeViewHandler, TVM_SELECTITEM, TVGN_CARET, Test1);现在的问题就是,程序可以控制另外一个进程中的Treeview的节点上下移动,但是好像并没有触发这个节点的Click事件?我想实现的就是如何向这个节点发送一个类似于click或者double click的消息或者实现类似的功能?谢谢!

解决方案 »

  1.   

    Have a trySend "Mouse_down" message to treeview
      

  2.   

    Have a trySend "Mouse_down" message to treeviewI have tried, but need the coordinate of the selected node, I can not got it, when I send the meesage TVM_GETITEMRECT to the node, the process which contains the treeview crashed, I have followed the methods:
    http://groups.yahoo.com/group/perlguitest/auth?check=G&done=http%3A%2F%2Fgroups%2Eyahoo%2Ecom%2Fgroup%2Fperlguitest%2Fmessage%2F1316http://www.devx.com/vb2themax/Tip/18992I don't know how to pass the handler of the selected node to the lpRect in C#.
    lpRect.Left = hItem
        If SendMessage(TV.hWnd, TVM_GETITEMRECT, IncludeTextOnly, lpRect) Then
            ' a non-zero value means that the item is visible
            GetTreeViewNodeRect = lpRect