summaryrefslogtreecommitdiffstats
path: root/src/detection/wallpaper/wallpaper_windows.c
blob: 2adf08394eb461562af69977d0085f8ec3320a01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "wallpaper.h"
#include "common/windows/registry.h"

const char* ffDetectWallpaper(FFstrbuf* result) {
    FF_AUTO_CLOSE_FD HANDLE hKey = NULL;
    if (!ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Control Panel\\Desktop", &hKey, NULL)) {
        return "ffRegOpenKeyForRead(Control Panel\\Desktop) failed";
    }

    if (!ffRegReadStrbuf(hKey, L"WallPaper", result, NULL)) {
        return "ffRegReadStrbuf(WallPaper) failed";
    }

    return NULL;
}