怎么对另外一个程序的SysListView32的行进行光标定位

magajoy 2006-11-29 01:00:03
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没有装完整,查不到相关的函数。烦啊
...全文
99 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
magajoy 2006-11-29
  • 打赏
  • 举报
回复
问题自己解决了,要分就回贴吧
magajoy 2006-11-29
  • 打赏
  • 举报
回复
终于解决了,用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.

Syntax

typedef 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;

magajoy 2006-11-29
  • 打赏
  • 举报
回复
csdn没人了吗?

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧