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 :)
Printable View
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 :)
bumpie bump
Same as in VB6, Do a search for it.
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:rolleyes:
anyone can give me a hint or something on how to use the framework for this?! :confused:
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
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.
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.
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....
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.
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); }
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.
thanks hellswraith :) I will try it... There should be a way to "refresh" the desktop though:rolleyes:
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