How to make the monitoring program displayed as wallpaper?

I made a simple C # program to display basic information about some of the machines that we have. The program runs in full screen mode and is updated every second. We have a special PC and a screen in the store to display it constantly, but some directors also want it on their PC, but are displayed as wallpapers.

Please tell me if there is an easy way to set the program as a dynamic wallpaper, because I did not find anything.

I think that the real solution would be to change the program so that it runs with a minimum value, and from time to time (for example, every 15 or 20 minutes) it generates an appearance image at its maximum magnification, and then sets this picture as wallpaper for desktop.

Does my decision make sense? How to create an image from a hidden application?

+6
source share
1 answer

Your decision makes sense.

You can change the f: om C # background 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 information on creating .bmp at runtime, you can read this forum post .

+1
source

All Articles