Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Desktop Wallpaper

Status
Not open for further replies.

exodus300

Programmer
Mar 22, 2002
262
AU
I tried changing the user's desktop wallpaper by changing the registry value HKCU\Control Panel\Desktop\Wallpaper but it didn't work. Should this way work, or is it done some other way?
NOTE: I am developing on ME, but this MUST work on XP.

Also does XP use the same registry key as 98 and ME, Software\Microsoft\Windows\CurrentVersion\Run for startup entries? [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
To the best of my knowledge this only works with a restart in between, i have never tried it though. Totte
 
Yes, I noticed (after posting) that when I rebooted (or logged of) the change took effect, but only with Active Desktop on (or off, I can't remember which).

Anyone know if there is a way to force this change? It must be possible, because Display Properties does it! [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
I did not test this api but it might do the trick:

SystemParametersInfo(SPI_SETDESKWALLPAPER, 0&, FileName, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)

and sorry for this post in vb code :)
 
Thank you, I will try this when I get to my own computer :) [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
Thank you it works (Win ME anyway). Haven't tried in XP though. However it only works with .bmp files, not gif or jpeg or html. Any ideas for these file formats? [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
See if this helps and James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
Thank you, this won't help me tell windows to displaya gif or jpeg as the desktop wallpaper, but I'm sure this will come in handy somewhere else.

What I need is to display GIF or JPEG files as the desktop wallpaper. The post above works for BMP files, but not for these other formats.

YOur help is much appreciated :)
Exodus300 [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
PS anyone know how to programmatically set the screen saver? I know systemparametersinfo for timeout, but not actual screen saver. Thanks! [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
Hi exodus

When you take a look at the scrfile entry in the registry you will see that it is set using this commandline:
"rundll32.exe desk.cpl,InstallScreenSaver %l"

The screensaver program is stored in a registry key:

[HKEY_CURRENT_USER\Control Panel\Desktop]
"SCRNSAVE.EXE"="C:\\WINNT\\HP.scr"

I would try to set the "SCRNSAVE.EXE" key to the new scr-file and run the SystemParametersInfo to activate it.
 
Thank you, I will try this. [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
I've tried the SystemParametersInfo in NT, and the screen just goes blank - is there some sort of refresh I need to call?

Cheers,
Douglas JL Common sense is what tells you the world is flat.
 
Does thje filename you passed point to a real file? if the file doesn't exist, you will probably get a blank background of your desktop colour. is this what is happening? [Thanks in advance|Hope I helped you]
Exodus300
World-Wide Alliance of Evil and Twisted People
[red]"Experimentation by Example is the best learning tool" - Exodus300[/red]
Code:
if (pop_tarts == 0)
{
   tantrum = 1;
}
[pc3]
 
I'll doublecheck, but I'm pretty certain that the file was valid. Common sense is what tells you the world is flat.
 
exodus,

If you're trying to tell the screen saver to run in XP programatically with something like systemparametersinfo, good luck. XP and 2K don't respond to those calls for some reason. I spend a week trying to work around it to tell the screen saver to programatically run and never accomplished the task. If you figure out how, please let me know Cyprus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top