mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 04:04:17 +01:00
Wallpaper (Windows): add new module
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef FF_INCLUDED_detection_wallpaper
|
||||
#define FF_INCLUDED_detection_wallpaper
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
const char* ffDetectWallpaper(const FFinstance* instance, FFstrbuf* result);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
#include "wallpaper.h"
|
||||
|
||||
const char* ffDetectWallpaper(FF_MAYBE_UNUSED const FFinstance* instance, FF_MAYBE_UNUSED FFstrbuf* result)
|
||||
{
|
||||
return "Not supported on this platform";
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include "wallpaper.h"
|
||||
#include "util/windows/registry.h"
|
||||
|
||||
const char* ffDetectWallpaper(FF_MAYBE_UNUSED const FFinstance* instance, FFstrbuf* result)
|
||||
{
|
||||
FF_HKEY_AUTO_DESTROY 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;
|
||||
}
|
||||
Reference in New Issue
Block a user