How can I get a screenshot of only the desktop with icons, that is, so that the taskbar windows do not get into the screenshot, where is the start , but only the desktop with icons?
var DesktopBitmap: TBitmap; begin DesktopBitmap.GetDC(GetDesktopWindow);
See more here: Screen Shuffling with Delphi .
You can take a screenshot of any window using bitblt . This function, I think, is what you need. A screenshot of the desktop can be done like this:
... var bmp:Tbitmap; ... begin bmp := TbitMap.Create; bmp.Width := screen.Width; bmp.Height := screen.Height; bitblt(bmp.canvas.Handle, 0, 0, screen.Width, screen.Height, getdc(FindWindow('ProgMan', nil)), 0, 0, SRCCOPY);