Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using RegEdit to change desktop background

964 views
Skip to first unread message

flint_and_steel

unread,
Sep 18, 2006, 2:52:01 AM9/18/06
to
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!

Ramesh, MS-MVP

unread,
Sep 18, 2006, 10:24:45 AM9/18/06
to
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


"flint_and_steel" <flinta...@discussions.microsoft.com> wrote in message
news:E780F631-926F-4DB4...@microsoft.com...

flint_and_steel

unread,
Sep 18, 2006, 1:35:02 PM9/18/06
to
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, MS-MVP

unread,
Sep 18, 2006, 1:57:28 PM9/18/06
to
SystemParametersInfo:
http://msdn.microsoft.com/library/default.asp?url=/library/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


"flint_and_steel" <flinta...@discussions.microsoft.com> wrote in message

news:E4021BC8-3B54-4125...@microsoft.com...

Ramesh, MS-MVP

unread,
Sep 18, 2006, 2:02:05 PM9/18/06
to
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


"Ramesh, MS-MVP" <ram...@XOX.mvps.org> wrote in message
news:uYE0Uv02...@TK2MSFTNGP03.phx.gbl...

Unknown

unread,
Sep 18, 2006, 3:25:01 PM9/18/06
to
"flint_and_steel" <flinta...@discussions.microsoft.com> wrote in message
news:E780F631-926F-4DB4...@microsoft.com...


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.


--
Alec S.
news/alec->synetech/cjb/net


flint_and_steel

unread,
Sep 18, 2006, 5:49:02 PM9/18/06
to
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

Donald A. Herman

unread,
Sep 18, 2006, 9:06:48 PM9/18/06
to
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, MS-MVP" <ram...@XOX.mvps.org> wrote in message
news:uYE0Uv02...@TK2MSFTNGP03.phx.gbl...

Ramesh, MS-MVP

unread,
Sep 19, 2006, 8:34:30 AM9/19/06
to
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


"Donald A. Herman" <dher...@netzero.com> wrote in message
news:ehIoif42...@TK2MSFTNGP06.phx.gbl...

Ramesh, MS-MVP

unread,
Sep 19, 2006, 8:34:44 AM9/19/06
to
You're welcome, flint_and_steel.

--
Regards,

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

"flint_and_steel" <flinta...@discussions.microsoft.com> wrote in message

news:0DD2A0B4-6ADF-4E20...@microsoft.com...

Donald A. Herman

unread,
Sep 19, 2006, 8:22:10 PM9/19/06
to
> 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, MS-MVP" <ram...@XOX.mvps.org> wrote in message

news:%23c1agf%232GH...@TK2MSFTNGP02.phx.gbl...

0 new messages