Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a monitoring program appear as wallpaper?

Tags:

c#

wallpaper

I made a simple C# program to display basic information about some machines we have. The program is full screen and refreshed every second. We have a dedicated PC and screen in the shop to display it constantly but some directors want it on their PC also, but appears as a wallpaper.

Please tell me if there is an easy way to set a program as a dynamic wallpaper, because I've found nothing.

I think the real solution would be to modify the program so that it runs minimized, and once in a while (like every 15 or 20 minute) it generates a image of the appearance when it is maximized, and then set that picture as the desktop wallpaper.

Does my solution make sense? How can I generate a picture from an hidden application?

like image 811
Remz1337 Avatar asked Feb 01 '13 23:02

Remz1337


People also ask

How do I set a background for a specific monitor?

To change desktop backgrounds individually for each monitor, head to Settings > Personalization > Background. Under Choose Your Picture, right-click a background image and select “Set For Monitor 1,” “Set For Monitor 2,” or whichever other monitor you want to use it on.

Can I set different wallpapers on dual monitors?

You can have different wallpapers on each monitor if you have a dual-monitor rig. Or a different wallpaper for each monitor if you have a multiple-monitor setup.


1 Answers

Your solution makes sense.

You can change the background f:om C# with the following code but it only works with .bmp image types:

[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern Int32 SystemParametersInfo(UInt32 uiAction, UInt32 uiParam, String pvParam, UInt32 fWinIni);
private static UInt32 SPI_SETDESKWALLPAPER = 20;
private static UInt32 SPIF_UPDATEINIFILE = 0x1;
private String imageFileName = "c:\\sample.bmp";

public void SetImage( string filename )
{
    SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, filename, SPIF_UPDATEINIFILE);
}

For info on creating a .bmp during runtime, you may read this forum post.

like image 151
Foggzie Avatar answered Oct 05 '22 11:10

Foggzie