   Capturing Windows Border Problem.
  Hi AllIam trying to grab images of all the windows that are currently open and visible on my desktop. The code I use is:void SaveScreen(HWND hwnd){if ( hwnd ){HDC hdcScreen = GetWindowDC(hwnd); if ( hdcScreen ){RECTrect;GetWindowRect(hwnd, &rect);intwidth = rect.right - rect.left;int height = rect.bottom - rect.top;HDC compat = CreateCompatibleDC(hdcScreen); if ( compat ){HBITMAP BitmapHandle = CreateCompatibleBitmap(hdcScreen, width, height); if ( BitmapHandle ){if ( SelectObject(compat, BitmapHandle) ){if ( BitBlt(compat, 0, 0, width, height, hdcScreen, 0, 0, SRCCOPY | CAPTUREBLT) )  {GetObject(BitmapHandle, sizeof(BITMAP), &Bitmap);// Save bitmap}}DeleteObject(BitmapHandle);}DeleteDC(compat);}ReleaseDC(hwnd, hdcScreen);}}}All seems to work but sometimes I get now borders/titlebar on windows, sometimes I get partial ones as seen here,Can anyone see where Iam going wrong, this is on a Vista 64bit system.Chris   