Using RegEdit to change desktop background

G

Guest

Using the key "HKEY_CURRENT_USER\Control Panel\Desktop" key, I am able to
change the value of the "Wallpaper" sub-key, but I cannot make the desktop
refresh itself with the new background. Is there a utility that I can run
using command lines (like from another program I have created) that will
refresh the desktop? If not, is there some other way to handle it?

[XP Pro SP2]

Thank you for your help!
 
R

Ramesh, MS-MVP

Method 1 - Courtesy of Torgeir Bakken, MVP.

Click Start, Run and type:

RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters

This command-line refreshes the desktop wallpaper (should be a .bmp file).

Method 2: Using a program that uses the "SystemParametersInfo" API call to
apply the desktop wallpaper dynamically. I wrote this program some time ago,
and you may use it if you're interested.

http://windowsxp.mvps.org/wprefresh.exe

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


Using the key "HKEY_CURRENT_USER\Control Panel\Desktop" key, I am able to
change the value of the "Wallpaper" sub-key, but I cannot make the desktop
refresh itself with the new background. Is there a utility that I can run
using command lines (like from another program I have created) that will
refresh the desktop? If not, is there some other way to handle it?

[XP Pro SP2]

Thank you for your help!
 
G

Guest

It appears that the Windows Desktop Cutomization program automatically
converts a *.jpg or *.gif file to a bitmap before it is set as the desktop
background image. Is there a way to run the same process externally, through
command lines or the like? Is there any documentation that may help?

Thank you for your help!
- flint_and_steel
 
R

Ramesh, MS-MVP

SystemParametersInfo:
http://msdn.microsoft.com/library/d...y/en-us/sysinfo/base/systemparametersinfo.asp

<excerpt>
SPI_SETDESKWALLPAPER:

Sets the desktop wallpaper. The value of the pvParam parameter determines
the new wallpaper. To specify a wallpaper bitmap, set pvParam to point to a
null-terminated string containing the name of a bitmap file. Setting pvParam
to "" removes the wallpaper. Setting pvParam to SETWALLPAPER_DEFAULT or NULL
reverts to the default wallpaper.

</excerpt>

To save the image in .BMP format, here is an example for C# and VB2005
http://msdn.microsoft.com/coding4fun/inthebox/wallpaper2/default.aspx

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


It appears that the Windows Desktop Cutomization program automatically
converts a *.jpg or *.gif file to a bitmap before it is set as the desktop
background image. Is there a way to run the same process externally,
through
command lines or the like? Is there any documentation that may help?

Thank you for your help!
- flint_and_steel
 
R

Ramesh, MS-MVP

BTW, the API information is for developers. I'm sorry to say that there is
no built-in command-line tool which can convert the images to .bmp. You need
a program to do it.

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


SystemParametersInfo:
http://msdn.microsoft.com/library/d...y/en-us/sysinfo/base/systemparametersinfo.asp

<excerpt>
SPI_SETDESKWALLPAPER:

Sets the desktop wallpaper. The value of the pvParam parameter determines
the new wallpaper. To specify a wallpaper bitmap, set pvParam to point to a
null-terminated string containing the name of a bitmap file. Setting pvParam
to "" removes the wallpaper. Setting pvParam to SETWALLPAPER_DEFAULT or NULL
reverts to the default wallpaper.

</excerpt>

To save the image in .BMP format, here is an example for C# and VB2005
http://msdn.microsoft.com/coding4fun/inthebox/wallpaper2/default.aspx
 
A

Alec S.

flint_and_steel said:
Using the key "HKEY_CURRENT_USER\Control Panel\Desktop" key, I am able to
change the value of the "Wallpaper" sub-key, but I cannot make the desktop
refresh itself with the new background. Is there a utility that I can run
using command lines (like from another program I have created) that will
refresh the desktop? If not, is there some other way to handle it?


If all you're looking for is a way to change the wallpaper from a script or the command line, then try Marty List's "Set Wallpaper".
It's perfect for this use.

Otherwise, you could use Ramesh's suggestion along with a program such as Image Alchemy, IrfanView, or some other program to convert
it to bitmap.
 
G

Guest

And that's exactly what I was intending to use it for. I have implemented
the changes, and it works great! Still working on the bitmap conversion,
though.

Thank you so much for your help!!

Regards,
flint_and_steel
 
D

Donald A. Herman

That's Cool

I've tried to use that API for refreshing the Run box after I clear the
History folder in IE then Merge a REG file with my preset entries. Would you
happen to know that parameter.

I hate waiting to restart for those commands to be available again.

--
Donald A. Herman
Software - Scheduler Pro, Disk Cataloger, Math Wizard
http://don_herman.tripod.com
Office Extras, Addins
http://don_herman.tripod.com/msoextras
..
..
Ramesh said:
SystemParametersInfo:
http://msdn.microsoft.com/library/d...y/en-us/sysinfo/base/systemparametersinfo.asp

<excerpt>
SPI_SETDESKWALLPAPER:

Sets the desktop wallpaper. The value of the pvParam parameter determines
the new wallpaper. To specify a wallpaper bitmap, set pvParam to point to
a
null-terminated string containing the name of a bitmap file. Setting
pvParam
to "" removes the wallpaper. Setting pvParam to SETWALLPAPER_DEFAULT or
NULL
reverts to the default wallpaper.

</excerpt>

To save the image in .BMP format, here is an example for C# and VB2005
http://msdn.microsoft.com/coding4fun/inthebox/wallpaper2/default.aspx

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


message
It appears that the Windows Desktop Cutomization program automatically
converts a *.jpg or *.gif file to a bitmap before it is set as the desktop
background image. Is there a way to run the same process externally,
through
command lines or the like? Is there any documentation that may help?

Thank you for your help!
- flint_and_steel

Ramesh said:
Method 1 - Courtesy of Torgeir Bakken, MVP.

Click Start, Run and type:

RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters

This command-line refreshes the desktop wallpaper (should be a .bmp
file).

Method 2: Using a program that uses the "SystemParametersInfo" API call
to
apply the desktop wallpaper dynamically. I wrote this program some time
ago,
and you may use it if you're interested.

http://windowsxp.mvps.org/wprefresh.exe

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


message
Using the key "HKEY_CURRENT_USER\Control Panel\Desktop" key, I am able to
change the value of the "Wallpaper" sub-key, but I cannot make the
desktop
refresh itself with the new background. Is there a utility that I can
run
using command lines (like from another program I have created) that will
refresh the desktop? If not, is there some other way to handle it?

[XP Pro SP2]

Thank you for your help!
 
R

Ramesh, MS-MVP

No idea how to clear the RunMRU dynamically. AFAIK, it uses an undocumented
API. Perhaps you can check with the SDK groups for more information. Dirty
way is to kill explorer.exe and restart it, but it may close all instances
of Internet Explorer also, depending upon how the system is configured.

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


That's Cool

I've tried to use that API for refreshing the Run box after I clear the
History folder in IE then Merge a REG file with my preset entries. Would you
happen to know that parameter.

I hate waiting to restart for those commands to be available again.

--
Donald A. Herman
Software - Scheduler Pro, Disk Cataloger, Math Wizard
http://don_herman.tripod.com
Office Extras, Addins
http://don_herman.tripod.com/msoextras
..
 
R

Ramesh, MS-MVP

You're welcome, flint_and_steel.

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


And that's exactly what I was intending to use it for. I have implemented
the changes, and it works great! Still working on the bitmap conversion,
though.

Thank you so much for your help!!

Regards,
flint_and_steel

:
 
D

Donald A. Herman

way is to kill explorer.exe and restart it, but it may close all instances
of Internet Explorer also, depending upon how the system is configured.

Yeah it does.

If I wait to close the "Internet Properties" after the merge the MRU is
refreshed with my items! So I know there is a way. Thanks though.

--
Donald A. Herman
Software - Scheduler Pro, Disk Cataloger, Math Wizard
http://don_herman.tripod.com
Office Extras, Addins
http://don_herman.tripod.com/msoextras
..
..
Ramesh said:
No idea how to clear the RunMRU dynamically. AFAIK, it uses an
undocumented
API. Perhaps you can check with the SDK groups for more information. Dirty
way is to kill explorer.exe and restart it, but it may close all instances
of Internet Explorer also, depending upon how the system is configured.

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


That's Cool

I've tried to use that API for refreshing the Run box after I clear the
History folder in IE then Merge a REG file with my preset entries. Would
you
happen to know that parameter.

I hate waiting to restart for those commands to be available again.

--
Donald A. Herman
Software - Scheduler Pro, Disk Cataloger, Math Wizard
http://don_herman.tripod.com
Office Extras, Addins
http://don_herman.tripod.com/msoextras
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top