I know this is a pretty late answer but I recently looked into it myself and if further user's have the same issue this might help them.
NOTE: This answer is for C++ but maybe it might help you do the same in C#
As mentioned in a comment above I followed This guide to understand how I would be able to draw ON the windows wallpaper window.
By using these two methods:
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) {
HWND p = FindWindowEx(hwnd, NULL, "SHELLDLL_DefView", NULL);
HWND* ret = (HWND*)lParam;
if (p)
{
// Gets the WorkerW Window after the current one.
*ret = FindWindowEx(NULL, hwnd, "WorkerW", NULL);
}
return true;
}
HWND get_wallpaper_window() {
// Fetch the Progman window
HWND progman = FindWindow("ProgMan", NULL);
// Send 0x052C to Progman. This message directs Progman to spawn a
// WorkerW behind the desktop icons. If it is already there, nothing
// happens.
SendMessageTimeout(progman, 0x052C, 0, 0, SMTO_NORMAL, 1000, nullptr);
// We enumerate all Windows, until we find one, that has the SHELLDLL_DefView
// as a child.
// If we found that window, we take its next sibling and assign it to workerw.
HWND wallpaper_hwnd = nullptr;
EnumWindows(EnumWindowsProc, (LPARAM)&wallpaper_hwnd);
// Return the handle you're looking for.
return wallpaper_hwnd;
}
I was able to retrieve the windows handle.
Since I was only familiar with SDL this was the only solution I found but I believe that any ways that allows you to create / modify a window based on another window should work.
window = SDL_CreateWindowFrom((void*)get_wallpaper_window());
The line above allowed me to create a window in SDL from the HWND retrieved by the get_wallpaper_window()
method.
Since there is a lot of code involved I will link my solution on github. This can draw a lot of stars (although I believe it can be improved) behind your desktop icons.