仅在 primary/secondary 显示器上设置墙纸

Set wallpaper on primary/secondary monitor only

大家好。

我知道如何设置壁纸声明

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);

然后使用

SystemParametersInfo(0x0014, 0, file, 0x01 | 0x02);

但这设置了墙纸,所有屏幕上的墙纸相同。

有什么方法可以select我想更新哪个屏幕?

我建议你阅读that article,了解后台如何使用双显示器。 您不需要在 2 个不同的显示器中放置 2 个图像,但您需要创建一个包含两个图像并作为背景的显示器。

链接文章的摘录:

The trick is to set your wallpaper to “tile” rather than “center” or “stretch”. When the window manager draws a tiled bitmap, it places the tiles so that the upper left corner of the primary monitor exactly coincides with the top left corner of a tile. The remaining tiles are then arranged around that anchor tile.