int iItem=0;//光标所在的行号
int iNum =5; //我要设置在第五行。
.....
....//得到另一个程序的窗口SysListView32的hwnd,并且有效
iItem=::SendMessage(hwnd,LVM_GETNEXTITEM,-1,LVNI_SELECTED); 
//得到光标的行号,在第iItem行
下一步,怎么将另一个程序的行号设在第五行,并让光标移动到第五行。然后:
iItem=::SendMessage(hwnd,LVM_GETNEXTITEM,-1,LVNI_SELECTED); 
//这时iItem为我要设置行号5而不是原来的数字
//MSDN没有装完整,查不到相关的函数。烦啊

解决方案 »

  1.   

    终于解决了,用LVITEM
    LVITEM Structure--------------------------------------------------------------------------------Specifies or receives the attributes of a list-view item. This structure has been updated to support a new mask value (LVIF_INDENT) that enables item indenting. This structure supersedes the LV_ITEM structure.Syntaxtypedef struct _LVITEM { 
        UINT mask; 
        int iItem; 
        int iSubItem; 
        UINT state; 
        UINT stateMask; 
        LPTSTR pszText; 
        int cchTextMax; 
        int iImage; 
        LPARAM lParam;
    #if (_WIN32_IE >= 0x0300)
        int iIndent;
    #endif
    #if (_WIN32_IE >= 0x560)
        int iGroupId;
        UINT cColumns; // tile view columns
        PUINT puColumns;
    #endif
    } LVITEM, *LPLVITEM;