C# 获取其他程序ListView控件中的内容介绍.doc

C# 获取其他程序ListView控件中的内容介绍.doc

ID:53872055

大小:97.50 KB

页数:5页

时间:2020-04-10

C# 获取其他程序ListView控件中的内容介绍.doc_第1页
C# 获取其他程序ListView控件中的内容介绍.doc_第2页
C# 获取其他程序ListView控件中的内容介绍.doc_第3页
C# 获取其他程序ListView控件中的内容介绍.doc_第4页
C# 获取其他程序ListView控件中的内容介绍.doc_第5页
资源描述:

《C# 获取其他程序ListView控件中的内容介绍.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、代码:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;usingSystem.Runtime.InteropServices;namespace读取其他软件li

2、stview控件的内容{publicpartialclassForm1:Form{inthwnd;//窗口句柄intprocess;//进程句柄intpointer;privateconstuintLVM_FIRST=0x1000;privateconstuintLVM_GETHEADER=LVM_FIRST+31;privateconstuintLVM_GETITEMCOUNT=LVM_FIRST+4;//获取列表行数privateconstuintLVM_GETITEMTEXT=LVM_FIRS

3、T+45;//获取列表内的内容privateconstuintLVM_GETITEMW=LVM_FIRST+75;privateconstuintHDM_GETITEMCOUNT=0x1200;//获取列表列数privateconstuintPROCESS_VM_OPERATION=0x0008;//允许函数VirtualProtectEx使用此句柄修改进程的虚拟内存privateconstuintPROCESS_VM_READ=0x0010;//允许函数访问权限privateconstuintPR

4、OCESS_VM_WRITE=0x0020;//允许函数写入权限privateconstuintMEM_COMMIT=0x1000;//为特定的页面区域分配内存中或磁盘的页面文件中的物理存储privateconstuintMEM_RELEASE=0x8000;privateconstuintMEM_RESERVE=0x2000;//保留进程的虚拟地址空间,而不分配任何物理存储privateconstuintPAGE_READWRITE=4;privateintLVIF_TEXT=0x0001;[Dl

5、lImport("user32.dll")]//查找窗口privatestaticexternintFindWindow(stringstrClassName,//窗口类名stringstrWindowName//窗口标题);[DllImport("user32.dll")]//在窗口列表中寻找与指定条件相符的第一个子窗口privatestaticexternintFindWindowEx(inthwndParent,//handletoparentwindow  inthwndChildAfter

6、,//handletochildwindowstringclassName,//窗口类名stringwindowName//窗口标题);[DllImport("user32.DLL")]privatestaticexternintSendMessage(inthWnd,uintMsg,intwParam,intlParam);[DllImport("user32.dll")]//找出某个窗口的创建者(线程或进程),返回创建者的标志符privatestaticexternintGetWindowThr

7、eadProcessId(inthwnd,outintprocessId);[DllImport("kernel32.dll")]//打开一个已存在的进程对象,并返回进程的句柄privatestaticexternintOpenProcess(uintdwDesiredAccess,boolbInheritHandle,intprocessId);[DllImport("kernel32.dll")]//为指定的进程分配内存地址:成功则返回分配内存的首地址privatestaticexternint

8、VirtualAllocEx(inthProcess,IntPtrlpAddress,uintdwSize,uintflAllocationType,uintflProtect);[DllImport("kernel32.dll")]//从指定内存中读取字节集数据privatestaticexternboolReadProcessMemory(inthProcess,//被读取者的进程句柄intlpBaseAddress,//开始读取的内存地址IntPtrlpBuff

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。