有没有一种方法可以使用pinvoke更改锁屏图像(如c#中的墙纸).[DllImport(user32.dll, CharSet = CharSet.Auto)]private static extern Int32 SystemParametersInfo(UInt32 action,UInt32 uParam, string vParam, U...

有没有一种方法可以使用pinvoke更改锁屏图像(如c#中的墙纸).
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern Int32 SystemParametersInfo(UInt32 action,
UInt32 uParam, string vParam, UInt32 winIni);
private static readonly UInt32 SPI_SETDESKWALLPAPER = 20;
private static UInt32 SPIF_UPDATEINIFILE = 0x1;
private static uint MAX_PATH = 260;
// then I call
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, file, SPIF_UPDATEINIFILE);
我想对锁定屏幕执行相同的操作(例如Bing Desktop应用程序正在执行的操作)
解决方法:
有了Windows 8标签,是的,您可以:
LockScreen.SetImageFileAsync()(如Windows 8 Lock screen personalization sample in C#所示)(省略了错误处理代码,请检查示例):
StorageFile imageFile = await imagePicker.PickSingleFileAsync();
// Application now has access to the picked file, setting image to lockscreen.
// This will fail if the file is an invalid format.
await LockScreen.SetImageFileAsync(imageFile);
织梦狗教程
本文标题为:在C#中更改Windows锁定屏幕背景图片


基础教程推荐
猜你喜欢
- Untiy Shader实现纹理贴图滚动 2023-01-16
- 浅谈C#中ListView类的用法 2023-03-09
- 利用C#实现绘制出地球旋转效果 2023-07-18
- C#如何注销Citrix XenApp用户会话? 2023-11-12
- WPF实现动画效果(六)之路径动画 2023-06-21
- C# SQLite数据库入门使用说明 2023-01-06
- Unity游戏开发中必备的设计模式之外观模式详解 2023-07-19
- C#实现简单点餐系统 2023-04-22
- C# SQLite库使用技巧 2023-05-11
- C#中字符串的一般性和特殊性 2022-11-03