win32helperapi
public class Win32Helper { [DllImport("user32.dll", EntryPoint = "SystemParametersInfoA")] internal static extern Int32 SystemParametersInfo(Int32 uAction, Int32 uParam, string lpvparam, Int32 fuwinIni); }
調用(win10背景圖:C:\Windows\Web\Wallpaper)url
void SetWallpaper(string imgPath) { int nResult; nResult = Win32Helper.SystemParametersInfo(20, 1, imgPath, 0x1 | 0x2); }
http://winapi.freetechsecrets.com/win32/WIN32SystemParametersInfo.htmspa