?
die "Breite" stimmt, die "Höhe" auch - jedoch nicht die "Anfangsposition" ... der Screenshot wird also etwas verschoben ... warum?
HWND hWnd = (HWND)StrToInt(worte->Strings[2]);
HDC DC = GetDC(hWnd);
RECT rc;
if (GetWindowRgn(hWnd,&rc) || GetWindowRect(hWnd, &rc))
{
Form1->HandleWindow->Picture->Bitmap->FreeImage();
HandleWindow->Picture->Bitmap->Handle = CreateCompatibleBitmap(DC, rc.right-rc.left, rc.bottom-rc.top);
if (GetDeviceCaps(DC, RASTERCAPS) & RC_PALETTE)
{
int palette_size = GetDeviceCaps(DC, SIZEPALETTE);
if (palette_size == 256)
{
const size_t size = sizeof(LOGPALETTE) + (palette_size-1) * sizeof(PALETTEENTRY);
unsigned char* pBuffer = new unsigned char[size];
LPLOGPALETTE lplogpal = reinterpret_cast<LPLOGPALETTE>(pBuffer);
lplogpal->palVersion = 0x300;
lplogpal->palNumEntries = palette_size;
GetSystemPaletteEntries(DC, 0, palette_size, lplogpal->palPalEntry);
HandleWindow->Picture->Bitmap->Palette = CreatePalette(lplogpal);
delete [] pBuffer;
}
}
BitBlt(HandleWindow->Picture->Bitmap->Canvas->Handle, 0, 0,
HandleWindow->Width, HandleWindow->Height,
DC, 0, 0, SRCCOPY);
ReleaseDC(Handle, DC);
Bitte HIIILFE!