|
-
Aug 5th, 2002, 02:09 AM
#1
How can I change the desktop wallpaper?
Yes I know it's a very general question, but I have no idea how to do this...
I'll be happy if someone could help
-
Aug 5th, 2002, 02:19 PM
#2
-
Aug 5th, 2002, 05:44 PM
#3
Lively Member
Same as in VB6, Do a search for it.
-
Aug 5th, 2002, 06:47 PM
#4
well I already searched for the vb6 version of it and it obviously uses windows API functions. I'm looking for a way to do it through .NET classes. That is, if possible at all
-
Aug 8th, 2002, 01:39 PM
#5
anyone can give me a hint or something on how to use the framework for this?!
-
Aug 8th, 2002, 01:55 PM
#6
Frenzied Member
i think you are going to have to use api. an alternate method would be to make a vb6 app with only a main sub and shell the command out to the vb6 app. that would keep your .net pure
although the api isn' that big a deal in truth most api is cross platform especial stuff like changing the desktop
i mean what do you think c++ uses win32 api is what it uses for everything
Magiaus
If I helped give me some points.
-
Aug 8th, 2002, 02:39 PM
#7
Lively Member
Found something that might be usefull AllApi.net I would find how to do it in vb6 and then find the api functions that are used and replace them with the All API thing.
-
Aug 8th, 2002, 04:47 PM
#8
PowerPoster
What is wrong with the search on the forums, it isn't working right....and while we are at it what is up with my post count being reset...
Anyway, if you can get the search to work, I asked this question a while ago, and got an answer (never got it to work though, maybe you can). It has to do with setting a registry key to the new file.
-
Aug 8th, 2002, 04:54 PM
#9
sight, I guess I'll have to wait for the search to be fixed then
Thanks cogman for the help.In VB6 you do it with SystemParametersInfo, I couldnt find an equivalent for it in .NET....
-
Aug 8th, 2002, 05:08 PM
#10
PowerPoster
I know it is a registry key that you change, and I am looking through a bunch of old code to find it. If I find it I will post it here.
The problem I had with it though, is it wouldn't take into effect until you logged off or shut down the system...didn't really look into it further though, I ended up not using it at all.
-
Aug 8th, 2002, 05:13 PM
#11
PowerPoster
Found it, it is in C# code...
VB Code:
private void ImageToWallpaper(string imagepath)
{
// This will set the desktop wallpaper to the current image.
RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel", true);
key = key.OpenSubKey("Desktop", true);
key.SetValue("Wallpaper", imagepath);
}
-
Aug 8th, 2002, 05:14 PM
#12
PowerPoster
You might want to add some error trapping, if the user dosen't have access to the registry, I think you will get an exception.
-
Aug 8th, 2002, 07:49 PM
#13
thanks hellswraith I will try it... There should be a way to "refresh" the desktop though
-
Aug 8th, 2002, 08:11 PM
#14
Frenzied Member
it is a reg key and you have to update and send a refresh to the desktop i believe. but i don't think it will work without api
well i was going to tell you to go to this really cool windows regisry site but i lost the link
sorry
Magiaus
If I helped give me some points.
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
|