已知窗体的句柄,怎样把这个窗体的画面抓取下来?

如题~~
[4 byte] By [fireskys] at [2008-5-22]
# 1
已知窗體的句柄為hwnd

GetWindowRect(hwnd, rRect)
lWidth = rRect.right - rrect.left
lHeight=rrect.botton - rrect.top
hdcScreen=GetDC(0)
Bitblt(ddc, 0, 0, lheight, lwidth, hdcscreen, rrect.left, rrect.top, lwidth, lheight, vbsrccopy)
releasedc(0, hdcscreen)

'其中 ddc為存儲抓出的圖片的目標DC,例如你用另一個picture控件保存,則為
Bitblt(picture.hdc, 0, 0, lheight, lwidth, hdcscreen, rrect.left, rrect.top, lwidth, lheight, vbsrccopy)
# 2
看这个窗体是否是DIRECTX的话要另类处理