Post Reply

Forums -> UltraMon™ SDK -> VB Wallpaper Changer
m0digital   2002-10-17 19:25
Has anyone contemplated this idea? Ever since I got dual monitors, I've been wishin I had a wallpaper cycler. My friend has been buggin me to write one, but i never had a need till now.

I havent looked inside the SDK yet, but can this be done?

Im thinkin about doin it in VB, but VC++ might be just as easy. Any ideas? I'll try to look in it this weekend, if im not lazy enough..heh

thanks.
Christian Studer   2002-10-17 23:46
If you want to cycle through existing UltraMon wallpapers, this would be quite easy to do with the RC2 release.

All you need to do is enumerate the .wallpaper files in the UltraMon wallpaper directories (locations are in the registry), then run UltraMonDesktop.exe with the /load parameter to activate a wallpaper. See UltraMon Help > Scripting for details.

Dynamically generating new wallpapers isn't supported though.

Christian Studer - www.realtimesoft.com
m0digital   2002-10-18 03:39
How are the .wallpaper files put together? Is there anyways I can write a program to generate the .wallpaper files?
Christian Studer   2002-10-18 06:29
Here's information about the .wallpaper file format:

4 byte signature: UMWP
2 byte version number: 1

information about the desktop configuration for which the wallpaper bitmap was created:

1 byte bool for Active Desktop enabled or not
2 byte short for number of monitors
2 byte short for number of enabled monitors
a RECT for each monitor, left and top are the position, right and bottom are the width and height. If the monitor is disabled, set all values to zero

wallpaper settings:

4 byte WALLPAPER for the wallpaper style
if wallpaper style is W_DESKTOP: a single WP_MONITOR_FILE
else a WP_MONITOR_FILE for each monitor

enum WALLPAPER { W_DESKTOP = 0, W_MONITOR };
enum BACKGROUND { BG_SOLID = 0, BG_GRAD_HORZ, BG_GRAD_VERT };
enum IMAGE { IM_CENTER = 0, IM_TILE, IM_STRETCH, IM_STRETCH_PROP };

struct WP_MONITOR_FILE
{
BACKGROUND bgType;
COLORREF color1;
COLORREF color2;
IMAGE imgStyle;
wchar_t imgFile[MAX_PATH]; // Unicode string
};

I'll probably add a COM object for reading/writing .wallpaper files in one of the next releases, this will be much easier to use, especially from VB.

Christian Studer - www.realtimesoft.com
Christian Studer   2002-11-29 09:20
UltraMon 2.1 will use version 2 of the wallpaper file format, which is slightly different. Let me know if you are interested in the updated spec.

Christian Studer - www.realtimesoft.com
Chris   2003-01-20 22:20
How did you go with this, i would like to have a desktop changer that changes the images on both monitors. Also i have differetn res monitors.

Is there any program that can do this?

Could i make a plugin for ultramon to do this (as in is it possible)?
Christian Studer   2003-01-20 23:44
It's possible if your application can write the .wallpaper files used by UltraMon (see specification above).

Once you have a .wallpaper file, you can then simply call UltraMonDesktop.exe with the /load parameter (see the Help for details). UltraMon will then generate a wallpaper bitmap and apply it to the desktop.

Let me know if you want to do this, I'll post the updated spec for 2.1.

Christian Studer - www.realtimesoft.com
Chris   2003-01-20 23:55
I will try anything once :).
Chris   2003-01-21 00:13
Ok just looked at the sommand line stuff to load the .wallpaper fiels.

This should be pretty easy, so when you get a change let me know the specs for the .wallpaper file and i can knock up some code, cheers.

Chris

PS if it is faster here is my ICQ no. 7406854
Christian Studer   2003-01-21 00:28
Here's the updated spec for 2.1:

4 byte signature: UMWP
2 byte version number: 2

information about the desktop configuration for which the wallpaper bitmap was created:

1 byte bool for Active Desktop enabled or not
4 byte DWORD for number of monitors
a RECT for each monitor, left and top are the position, right and bottom are the width and height.
if the monitor is disabled, the rect is zeroed

wallpaper settings:

4 byte WALLPAPER for the wallpaper style
4 byte DWORD for the number of WP_MONITOR_FILE structs
one or more WP_MONITOR_FILE structs

enum WALLPAPER { W_DESKTOP = 0, W_MONITOR = 1 };
enum BACKGROUND { BG_SOLID = 0, BG_GRAD_HORZ = 1, BG_GRAD_VERT = 2 };
enum IMAGE { IM_CENTER = 0, IM_TILE = 1, IM_STRETCH = 2, IM_STRETCH_PROP = 3 };

struct WP_MONITOR_FILE
{
BACKGROUND bgType;
COLORREF color1;
COLORREF color2;
IMAGE imgStyle;
wchar_t imgFile[MAX_PATH]; // Unicode string
};

The first part of the file, desktop configuration information, is used by UltraMon to determine if the wallpaper bitmap needs to be refreshed. When creating or updating the .wallpaper file, you would set this to the current desktop configuration.

You can use the UltraMon COM objects to get information about installed monitors, see Help > Scripting for details.

Christian Studer - www.realtimesoft.com
Chris   2003-01-21 07:28
is the value of MAX_PATH fixed if so what is it?
Christian Studer   2003-01-21 07:43
MAX_PATH is 260. You can also contact me on ICQ if you have further questions, I'll be online for the next couple hours. ICQ #85907060.

Christian Studer - www.realtimesoft.com
Chris   2003-02-10 19:56
Hey i have been looking at the code i had done.
It work and all, still need some work but.
One Question.

The Monitor setting does not seam to work properly.
I want to be able to overide the monitor positions and sizes
so the code would be
.RECT_monitor(0).left = 128
.RECT_monitor(0).top = 0
.RECT_monitor(0).Right = 1024
.RECT_monitor(0).Bottom = 600

.RECT_monitor(1).left = 1280
.RECT_monitor(1).top = 0
.RECT_monitor(1).Right = 1024
.RECT_monitor(1).Bottom = 768

This way the picture would not take all the space on the main monitor and my coolmon stuff would always be readable.
Christian Studer   2003-02-11 03:16
Hey Chris,

this won't work, the monitor settings are only used to determine if the bitmap for a wallpaper needs to be regenerated. They have no effect on the wallpaper layout.

Christian Studer - www.realtimesoft.com
Chris   2003-02-11 13:46
Can it be made work?
Christian Studer   2003-02-12 00:45
I'll consider this for a future release.

Christian Studer - www.realtimesoft.com
Chris   2003-02-12 14:30
Ok sounds good.

Also could you please add the install path to the registery please?

we need to be easly able to find the EXE file.
Christian Studer   2003-02-13 00:32
You can use the following code to get the full path/name of the UltraMon wallpaper manager:
Set msi = CreateObject("WindowsInstaller.Installer")
umDesktopExe = ""
cmpIds = Array("{BEDCF68A-6628-48D7-ABA9-85A28ACE5B6C}", "{B8105F70-BFBE-4FCC-99B7-81417F56AAF6}")
i = 0
Do While umDesktopExe = "" And i <= UBound(cmpIds)
For Each prod In msi.ComponentClients(cmpIds(i))
umDesktopExe = msi.ComponentPath(prod, cmpIds(i))
Exit For
Next
i = i + 1
Loop
If umDesktopExe is still an empty string after the loop, the wallpaper manager isn't installed (it's an optional feature).

Christian Studer - www.realtimesoft.com
GreatRewards   2005-01-18 02:08
um... did you ever get that Wallpaper changer finished? If so, where can I get a copy?

Thanks,
Kevin
m0digital   2005-08-02 06:54
Ok, years have passed. I have slotted some time to develop this wallpaper changer. It will be developed in C#. I will post my progress in the next few weeks.

Has the function to generate the .wallpaper files been implemented yet?
Christian Studer   2005-08-02 09:42
This hasn't been added yet.

I'm considering adding a wallpaper changer in UltraMon 3, but don't know yet if there will also be an API for generating .wallpaper files.

UltraMon 2.6 still uses version 2 .wallpaper files.

Christian Studer - www.realtimesoft.com
m0digital   2005-08-03 07:02
I may be bypassing the .wallpaper file all together.
Raughnbo   2007-02-11 00:37
I have a dual monitor set up with the 2nd monitor (on the right) set as my primary monitor extended to a secondary monitor (on the left)both display settings and UltraMon Desktop Wallpaper show both monitors set up properly. The preveiw of a wallpaper streched over bothe monitors shows properly but when it is apllied the left half of the picture shows up on the right (2nd monitor) and the right half of the picture shows up on the left (secondary monitor).
Christian Studer   2007-02-11 10:21
Are you using Windows Vista?

Christian Studer - www.realtimesoft.com
Starkiller   2007-07-02 04:30
since it hasn't happend in 4 years, can I assume that this wallpaper changer were abandoned?

--
Starkiller
Christian Studer   2007-07-02 09:54
Probably yes, but there's a script which does the same thing: UltraMon Wallpaper Auto Changer.

Please note that the script doesn't yet work with UltraMon 3.

Christian Studer - www.realtimesoft.com
Forums -> UltraMon™ SDK -> VB Wallpaper Changer

Post Reply