How to make a monitoring program appear as wallpaper?
Asked Answered
K

1

6

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?

Kiva answered 1/2, 2013 at 23:49 Comment(0)
C
1

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.

Covarrubias answered 2/2, 2013 at 0:0 Comment(1)
thank you, i already had an idea on how to change the windows wallpaper but your solution is a no brainer, a+! however, even after reading the forum post you linked, i am totally in the dark about generating a .bmp of an hidden or minimized programKiva

© 2022 - 2024 — McMap. All rights reserved.