Prevent drawing over a child window under WorkerW when wallpaper is changed

76 Views Asked by At

after reading this article and trying in c++

https://www.codeproject.com/Articles/856020/Draw-Behind-Desktop-Icons-in-Windows-plus

I managed to set my window as child of the WorkerW window which draws behind the desktop icons
enter image description here

but the problem is when user changes to next wallpaper or slideshow happens, I detect the event after the animation has started which changes the wallpaper using a fade animation , a new WorkerW is spawned which draws on top of the existing WorkerW, so is there any way to get the new WorkerW handle to draw behind my window or make my window child of the new WorkerW very fast so that the drawing over my window is not noticeable?

https://youtu.be/N4XC7VLpPi0

:: After applying Lemi's way -> enter image description here

[Edit 2 :]

I managed to place my window inside the SHELLDLL view and on top of the desktop icons (i.e. the list view) [GLFW30 named one]

enter image description here

To Reproduce:

  1. Get a window handle from any appplication.

  2. Open Spy++ and find the window handle of the SHELLDLL view and convert it from hex to decimal , and then pass it in the SetParent(windowHWND, targetHWND).

  3. SetWindowPos pass the listView32 window handle as the hwndInsertAfter parameter and then run the program , our current window will get placed below the listview32 enter image description here

But sad thing , the listview32 overrides all the background painting by my window and only shows the current windows wallpaper :(

enter image description here

0

There are 0 best solutions below