一小段程序,但是运行的时候内存会不断增加,请给看看怎么回事?

就是取屏幕上某点的颜色值:

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
TPoint ScreenPos;
HDC DC = GetDC(0);
GetCursorPos(&ScreenPos);
StaticText1->Color=TColor(GetPixel(GetDC(0),ScreenPos.x,ScreenPos.y));
ReleaseDC(0, DC); //释放掉了,但内存还是会不断增长,为啥?
BYTE nRed=GetRValue(StaticText1->Color);
BYTE nGreen=GetGValue(StaticText1->Color);
BYTE nBlue=GetBValue(StaticText1->Color);
}
[459 byte] By [lltt-清风渐去云已淡] at [2008-1-9]
# 1
StaticText1->Color=TColor(GetPixel(GetDC(0),ScreenPos.x,ScreenPos.y));
这里面的GetDC没有释放
maozefa-阿发伯 at 2007-10-18 > top of Msdn China Tech,C++ Builder,基础类...
# 2
改为:
StaticText1->Color=TColor(GetPixel(DC, ScreenPos.x,ScreenPos.y));
maozefa-阿发伯 at 2007-10-18 > top of Msdn China Tech,C++ Builder,基础类...
# 3
谢谢,谢谢咧~~~~~ 呵呵