views:

762

answers:

2

I have a code snippet to set a single image across both monitors but I recently got a second monitor for my laptop and I wanted to modify my code to account for setting a diffrent image to each monitor.

Any ideas?

(this code snipet for single monitor is:

[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 = 0x14;
        private static readonly UInt32 SPIF_UPDATEINIFILE = 0x01;
        private static readonly UInt32 SPIF_SENDWININICHANGE = 0x02;

        private void SetWallpaper(string path)
        {
            if (path != null)
            {

                string savepath = Settings.Default.SavePath;

                Image imgInFile = Image.FromFile(path);
                imgInFile.Save(savepath, ImageFormat.Bmp);
                SystemParametersInfo(SPI_SETDESKWALLPAPER, 3, savepath, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE);
            }
            else
            {
                MessageBox.Show("Path Null");
            }
        }

)

+2  A: 

You're looking for:

How do I put a different wallpaper on each monitor? - Raymond Chen

Anthony Mills
+1  A: 

There is no difference actually.

Think of multiple monitors as just making the wallpaper space bigger.

So what you have to do is create a wallpaper image out of multiple images to fill in the rectangles areas for each monitor.

This questions also looks like a duplicate

Shane Powell
how embarrassing I forgot all about that. I did a search for dual monitor wallpaper and i didn't even see that.+1 for the find
Crash893