C的代码转换成delphi代码
C的代码转换成delphi代码
是一段C 取句柄的代码。帮忙翻译成delphi 的。。。感激不尽
void __stdcall CrnGetStatusBarItem(HANDLE hStatusBar, TStrings *pList)
{
DWORD dwProcessID;
HANDLE hProcess;
LPVOID lpCommon;
int nAllocSize = 255;
int nPnlLen;
char szBuf[255];
DWORD dwBytesRead;
int nPnlCount = SendMessage(hStatusBar, SB_GETPARTS, 0, 0);
pList->Add("StatusBar的项目数: " + String(nPnlCount));
GetWindowThreadProcessId(hStatusBar, &dwProcessID);
hProcess = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ |
PROCESS_VM_WRITE, false, dwProcessID);
lpCommon = VirtualAllocEx(hProcess, NULL, nAllocSize,
MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
for(int i=0; i <nPnlCount; i++)
{
SendMessage(hStatusBar, SB_GETTEXT, i, LPARAM(lpCommon));
ReadProcessMemory(hProcess, lpCommon, szBuf, 255, &dwBytesRead);
pList->Add(szBuf);
}
VirtualFreeEx(hProcess, lpCommon, 0, MEM_RE
相关问答:
写了个测试程序如下
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
已知Python 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试
在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......
#include "stdio.h"
int main()
{
char *ch(char *, char *);
char str1[]="I am glad to meet you!";
char str2[]="Welcom to study C!";
&nb ......
分别用结构化方法和面向对象方法编程实现下面要求:
对Circle和Rectangle实现以下功能Center,Move,Rotate,Print.
自己先订以下,这是一个刚学习计算机的人问我的
学习,看看
继续顶哦
学习了。
go o ......