|
-
Jun 7th, 2002, 12:17 PM
#1
Set Desktop Wallpaper???
Anyone know how to set the Desktop Wallpaper on a users machine through .Net code yet?
I tried this (a long shot):
Microsoft.Win32.UserPreferenceCategory.Desktop = viewAreaPic.Image;
Didn't work though. Maybe someone has done this or can give me a kick in the right direction...
-
Jun 10th, 2002, 09:21 AM
#2
Addicted Member
This works.
Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Control Panel", True)
Try
key = key.OpenSubKey("Desktop", True)
key.SetValue("Wallpaper", "YOUR IMAGE")
Catch ex As Exception
End Try
Wind and waves resolves all problems.
-
Jun 10th, 2002, 06:53 PM
#3
cim3, thanks for the reply, but that didn't work on my computer.
I switch the code to C# syntax it is here:
Code:
RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel", true);
try
{
key = key.OpenSubKey("Desktop", true);
key.SetValue("Wallpaper", thumbPanel.CurrentThumbPath.ToString());
}
catch
{
// Something went wrong.
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|