1
This commit is contained in:
29
Src/Unity/Scripts/Win64/GetWindowsWallPaper.cs
Normal file
29
Src/Unity/Scripts/Win64/GetWindowsWallPaper.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BITKit
|
||||
{
|
||||
|
||||
public class GetWindowsWallPaper
|
||||
{
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
static extern bool SystemParametersInfo(int uAction, int uParam, StringBuilder lpvParam, int fuWinIni);
|
||||
|
||||
const int SPI_GETDESKWALLPAPER = 0x0073;
|
||||
const int MAX_PATH = 260;
|
||||
|
||||
public static string GetWallpaperPath()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(MAX_PATH);
|
||||
if (SystemParametersInfo(SPI_GETDESKWALLPAPER, sb.Capacity, sb, 0))
|
||||
{
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
11
Src/Unity/Scripts/Win64/GetWindowsWallPaper.cs.meta
Normal file
11
Src/Unity/Scripts/Win64/GetWindowsWallPaper.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45155c6ffea0e34428dd2cfabd1b7deb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user