vb问题关于内存

来源:百度知道 编辑:UC知道 时间:2024/06/05 12:12:53
WriteProcessMemory(hProcess, &H44CB18, retV, 2, 0)

这些都代表什么意思?

VB函数原型:
Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
作用:写内存
说明:
hProcess , 进程的句柄
lpBaseAddress, 进程地址
lpBuffer, 数据存放地址
nSize, 数据的长度
lpNumberOfBytesWritten,实际数据的长度
nSize以字节为单位,一个字节Byte等于8位
基本数据类型的长度
ShortInt 8位 = 1Byte
SmallInt 16位 = 2Byte
Integer 16位 = 2Byte
LongInt 32位 = 4Byte
Word 16位 = 2Byte
LongWord 32位 = 4Byte
Boolean 8位 = 1Byte
WordBool 16位 = 2Byte
LongBool 32位 = 4Byte
比如要写入Integer类型的数据,那么Integer长度2Byte
所以nSize = 2