1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
HWND wallpaper_hwnd = nullptr;
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
HWND p = FindWindowEx(hwnd, NULL, L"SHELLDLL_DefView", NULL);
if (p)
{
wallpaper_hwnd = FindWindowEx(NULL, hwnd, L"WorkerW", NULL);
}
return true;
}
void get_wallpaper_window()
{
HWND progman = FindWindow(L"ProgMan", NULL);
SendMessageTimeout(progman, 0x052C, 0, 0, SMTO_NORMAL, 1000, nullptr);
EnumWindows(EnumWindowsProc, NULL);
return;
}
| |