Вопрос

I'm sorry for maybe asking the obvious. But I want to ask anyways because maybe there is a hidden way to do that. Of course all programmatically.

  • Can I capture a desktop screenshot without all the windows on top of it ?

    • just background (image) and icons ?
    • just background (image) and no icons ?
    • just background without wallpaper (no icons prefered)

If it was just for me I could hide or minimize all windows but it's not just for me so I would like to find a way without being user unfriendly. WinApi is the keyword but the question remains if it is actually possible.

Это было полезно?

Решение 2

With the help of Ch33f's comment this helps!

// load desktop Wallpaper
// or
BackColor = SystemColors.Desktop;

Другие советы

I'm not a WinApi pro but my idea would be something like this:
Assuming you allready know how to do a "usual" screenshot with your code (i don't) you could try to get all existing window handles and hide all the windows, take the screenshot and unhide them again afterwards.
That would at least make the with icons possible.

Just google for something like "winapi iterating through window handles" and "winapi hide window handle".
I do know for shure there is some funktion for hiding a window you got a handle for and I think there is a way to iterate through the existing handles.
You might need to import these funktion from a dll.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top