Multi Monitor Screen Saver

Posted 01 September 2009 - 10:18 AM

Hullo,

I started messing around with the Visual Studio 2005 C# Screen Saver Starter Kit as I wanted to make my own customized screen saver. The provided starter kit works great on a single monitor, however I have two monitors at my workstation and the screen saver from the kit only seems to show up on whichever monitor is flagged as the primary display.

I've got one video card that has one DVI output with some kind of Y connector attaching the two monitors.

The monitors are listed as 'Plug and Play Monitor on 256MB Radeon X600' and 'Plug and Play Monitor on 256MB Radeon X600 Secondary' in the Display section of the Settings tab of the display properties window thingy.

There is what appears to be an excellent tutorial here at Dreamincode.net but the sample screen saver provided only appears to run on the primary monitor as well...

Nevertheless, after reading over the tutorial it seemed simple enough to at least try converting the Screen Saver Starter Kit to support multi monitors. This is of course didn't work either. Here's the code I have now in the project:

Interestingly enough, when I try to debug this project using the Visual Studio debugger, I can step through line by line until it hits the Application.Run() method after running the ShowScreenSaver() method. At this point the Visual Studio window seems to freeze (in fact everything on that monitor seems frozen) and the only way to 'unfreeze' is to kill the screensaver vshost process using the task manager. Just for fun I tried renaming the compiled executable to a .scr file and set that as my screen saver and it works, but once again only for the primary monitor.

Is there something inherently wrong with the way I have things set up? The default Microsoft screensavers that come stock with Windows XP work fine with multiple monitors, why won't mine?

Re: Multi Monitor Screen Saver

Posted 02 September 2009 - 05:49 AM

Ok, unfortunately that didn't work either. I've attached a screenshot of what it looks like when the screen saver is running:

So the face you see on the right is actually my desktop background, same with the thin vertical bar on the far left. The thin vertical bar on the far left is where my taskbar usually is (I prefer the vertical task bar for space reasons. )

When the WindowState was set to Maximized the saver covered the first screen completely.

The picture attached looks weird because it is GIF image, the png format is too big to be attached

Once again, thanks for your help so far! I know we can figure this out

Re: Multi Monitor Screen Saver

Thanks djkitt! The screen saver is now displaying on both monitors which is awesome. I think my problem was that I commented this out of the SetupScreenSaverMethod()

Bounds = Screen.PrimaryScreen.Bounds;

Quote

Note: Because of the way the screens are started and the Application.Run is called the program does not stop running after the screen saver is cleared.

I see. I also notice also that moving the mouse/keyboard only clears one screen at a time. So I move the mouse a bit and the secondary display's saver disapears, and then I move the mouse some more and then the primary display is cleared. I'm assuming that is also due to the way the the forms are shown along with Application.Run()

Is there any way of working around this so that the application exits when either the mouse or keyboard are pressed?