http://www.cnblogs.com/Charltsing/p/slv32.html
歡迎交流:QQ564955427
讀取標准的32位listview控件中的數據,網上已經有很多代碼了。今天有空寫了個工具,測試讀取TcpEye軟件中的數據成功。
具體見程序附件。 工具下載 v1.0 (本程序可以自己選擇過濾窗口標題或者類名,然后再右側選擇要抓取的listview控件,點擊讀取按鈕即可),推薦先用Spy++查找窗體。
運行本工具需要.net4.5框架。
***************************************************************
如果程序要自適應32位和64位的系統,代碼還是需要做一下調整,因為兩者數據格式貌似不一致
下面有個C++的定義,網上找的,留個備份
typedef struct {
UINT mask;
int iItem;
int iSubItem;
UINT state;
UINT stateMask;
int placeholder1;
LPTSTR pszText;
int placeholder11;
int cchTextMax;
int iImage;
LPARAM lParam;
int placeholder2;
#if (_WIN32_IE >= 0x0300)
int iIndent;
#endif
#if (_WIN32_WINNT >= 0x0501)
int iGroupId;
UINT cColumns;
int placeholder3;
UINT puColumns;
int placeholder4;
#endif
#if (_WIN32_WINNT >= 0x0600)
int piColFmt;
int placeholder5;
int iGroup;
int placeholder6;
#endif
} LVITEM64, *LPLVITEM64;