怎么实现TestDirector那种SnapShot?(把鼠标拖到某个程序的控件上,即可选中该控件并拍照)

如何实现TestDirector那种SnapShot?(把鼠标拖到某个程序的控件上,即可选中该控件并拍照)
如何实现TestDirector那种SnapShot?(把鼠标拖到某个程序的控件上,即可选中该控件并拍照)。
请老大们指点指点。谢谢。

------解决方案--------------------
OnMouseMove中
if(nFlags == MK_LBUTTON)
{
ShowWindow(SW_HIDE); //隐藏自身窗口
SetCapture(); //捕捉鼠标
ClientToScreen(&point);
HWND hwndCapture=(HWND)::WindowFromPoint(point); //目标窗口

// 拍照
::GetWindowRect(hwndCapture,&rectCapture);
int nWidth=rectCapture.Width();
int nHeight=rectCapture.Height();
HDC hdcScreen, hMemDC;
HBITMAP hBitmap, hOldBitmap;
hdcScreen = CreateDC( "DISPLAY ", NULL, NULL, NULL);
hMemDC = CreateCompatibleDC(hdcScreen);
hBitmap = CreateCompatibleBitmap(hdcScreen, nWidth, nHeight);
hOldBitmap =(HBITMAP)SelectObject(hMemDC, hBitmap);
BitBlt(hMemDC, 0, 0, nWidth, nHeight, hdcScreen,rectCapture.left,rectCapture.top,SRCCOPY);
hBitmap =(HBITMAP)SelectObject(hMemDC, hOldBitmap);
DeleteDC(hdcScreen);
DeleteDC(hMemDC);
}