Open darclander opened 3 years ago
Spy++ reveals the layouts/differences across machines. Try something like this:
// See if WorkerW (class) is a child of program manager ('progman').
IntPtr workerW = Win32.FindWindowEx(GetProgramManagerWindowHandle(), IntPtr.Zero, "WorkerW", null);
// If that doesn't work, try searching alternative layout.
if (workerW == IntPtr.Zero)
{
// Enumerate top-level windows until finding SHELLDLL_DefView as child.
Win32.EnumWindows(new Win32.EnumWindowsProc((topHandle, topParamHandle) =>
{
IntPtr SHELLDLL_DefView = Win32.FindWindowEx(topHandle, IntPtr.Zero, "SHELLDLL_DefView", null);
if (SHELLDLL_DefView != IntPtr.Zero)
{
// If found, take next sibling as workerW.
// > Gets the WorkerW Window after the current one.
workerW = Win32.FindWindowEx(IntPtr.Zero, topHandle, "WorkerW", null);
}
return true;
}), IntPtr.Zero);
}
It should be found now, if it exists. You can SetParent to this handle to get live wallpapers.
@MirzaBeig wow thank you very much! I had in mind a similar solution but sadly I have been offline for too long to even attempt to solve this... :D I will see if I can implement your suggestion soon!
All the best!
For some versions of windows (incorrectly installed or non-purchased versions) it seems like the function
get_wallpaper_window()
does not return a correctHWND
to the windows wallpaper but instead returns0
.Any solutions for this would be greatly appreciated.