c#设置桌面壁纸
2008-01-15 22:36
381 查看
其实就是调用系统api而已,原型是:
BOOL WINAPI SystemParametersInfo(
__in UINT uiAction,
__in UINT uiParam,
__in_out PVOID pvParam,
__in UINT fWinIni
);
1using System.Runtime.InteropServices;
//////声明下
2[DllImport("user32.dll", EntryPoint = "SystemParametersInfoA")]
3static extern Int32 SystemParametersInfo(Int32 uAction, Int32 uParam, string lpvParam, Int32 fuWinIni);//////lpvParam要设置成string
4private const int SPI_SETDESKWALLPAPER = 20;
5
6SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, filename, 1);/////调用,filename为图片地址,最后一个参数需要为1,0的话在重启后就变回原来的了
至少vista下成功了。
BOOL WINAPI SystemParametersInfo(
__in UINT uiAction,
__in UINT uiParam,
__in_out PVOID pvParam,
__in UINT fWinIni
);
1using System.Runtime.InteropServices;
//////声明下
2[DllImport("user32.dll", EntryPoint = "SystemParametersInfoA")]
3static extern Int32 SystemParametersInfo(Int32 uAction, Int32 uParam, string lpvParam, Int32 fuWinIni);//////lpvParam要设置成string
4private const int SPI_SETDESKWALLPAPER = 20;
5
6SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, filename, 1);/////调用,filename为图片地址,最后一个参数需要为1,0的话在重启后就变回原来的了
至少vista下成功了。
相关文章推荐
- 用C#三两下设置桌面壁纸[C#实例学习系列]
- C#获取当前电脑桌面的壁纸,并设置成窗体背景图
- 设置c#windows服务描述及允许服务与桌面交互的几种方法
- 在GNU/Linux下设置与定时更换桌面壁纸
- python爬虫-抓取acg12动漫壁纸排行设置为桌面壁纸
- 利用Powershell每天自动设置提取Win10的windows聚焦图片(Spotlight)作为桌面壁纸的方法
- UWP 设置桌面壁纸、锁屏图片
- 将本地图片设置为桌面壁纸方法
- Win7如何设置桌面壁纸全屏显示?Win7桌面壁纸全屏显示的方法
- python设置windows桌面壁纸的实现代码
- 下载bing图片并设置成桌面壁纸
- win10桌面壁纸和主题颜色怎么设置?
- python设置windows桌面壁纸
- C#获取桌面壁纸图片的路径(Desktop Wallpaper)
- 设置桌面壁纸代码
- C# 实现设置桌面背景图片的功能
- 设置C# Windows 服务与桌面交互
- ubuntu 中设置3D桌面不同壁纸的方法
- windows server 2008 组策略-----设置桌面壁纸
- 设置c#windows服务描述及允许服务与桌面交互的几种方法(作者博客还有一大堆C#创建服务的文章)