这个是C#代码,请问vc代码应该怎么写
public List<string> GetColumnsHeaderText(int processHandle, int headerhwnd, int colCount)
{
List<string> list = new List<string>();
uint dwSize = 0x100;
int lpBaseAddress = WindowsAPIHelper.VirtualAllocEx(processHandle, IntPtr.Zero, (uint) Marshal.SizeOf(typeof(HDITEM)), 0x3000, 4);
int num3 = WindowsAPIHelper.VirtualAllocEx(processHandle, IntPtr.Zero, dwSize, 0x3000, 4);
for (int i = 0; i < colCount; i++)
{
byte[] arr = new byte[dwSize];
HDITEM structure = new HDITEM {
mask = (uint) this.HDI_TEXT,
fmt = 0,
cchTextMax = (int) dwSize,
pszText = (IntPtr) num3
};
IntPtr ptr = Marshal.AllocCoTaskMem(Marshal.SizeOf(structure));
Marshal.StructureToPtr(structure, ptr, false);
uint vNumberOfBytesRead = 0;
bool flag = WindowsAPIHelper.WriteProcessMemory(processHandle, lpBaseAddress, ptr, Marshal.SizeOf(typeof(HDITEM)), ref vNumberOfBytesRead);
WindowsAPIHelper.SendMessage(headerhwnd, 0x1203, i, lpBaseAddress);
WindowsAPIHelper.ReadProcessMemory(processHandle, num3, Marshal.UnsafeAddrOfPinnedArrayElement(arr, 0), (int) dwSize, ref vNumberOfBytesRead);
string str = Encoding.Default.GetString(arr, 0, (int) vNumberOfBytesRead);
string item = "";
foreach (char ch in str)
{
if (ch == '\0')
{
break;
}
item = item + ch;
}
list.Add(item);
}
WindowsAPIHelper.VirtualFreeEx(processHandle, lpBaseAddress, 0, 0x8000);
WindowsAPIHelper.VirtualFreeEx(processHandle, num3, 0, 0x8000);
return list;
}
------解决思路----------------------

------解决思路----------------------
帮结帖+蹭分
------解决思路----------------------
LS +1
