Hi,
How can i change wallpaper in vista using VB 6?
Very thanks.
Printable View
Hi,
How can i change wallpaper in vista using VB 6?
Very thanks.
Do you mean that you used the regular code which we use in previous windows versions and it failed with vista ?
Edit : Anyway here is the code :
vb Code:
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long Const SPI_SETDESKWALLPAPER = 20 Const SPIF_UPDATEINIFILE = &H1 Private Sub cmdSetWallpaper_Click() SystemParametersInfo SPI_SETDESKWALLPAPER, 0, "C:\image.bmp", SPIF_UPDATEINIFILE End Sub
I suppose it works only with bitmaps :confused:
Ok, very thanks msayed2004. How can i rate you? place the link if possible. Tnx again.
It's the icon of the scales at the bottom-left of his post (next to the red triangle).
Tnx. Now how can i set position(Center, strech...) on this application(VB)? Very very thanks.
Not 100% sure about its accuracy but try to update some registry values before my code :
Key : HKEY_CURRENT_USER\Control Panel\Desktop
Values :
-Tilewallpaper
-Wallpaperstyle
For a center-ed wallpaper :
Set Tilewallpaper to : 0
Set Wallpaperstyle to : 0
For a stretch-ed wallpaper :
Set Tilewallpaper to : 0
Set Wallpaperstyle to : 2
For a tile-ed wallpaper :
Set Tilewallpaper to : 1
Set Wallpaperstyle to : 0
Now try the SystemParametersInfo API as before.
Please tell me if it worked , I am busy now so I can not test it by myself.
Regards.
Can you add position setting in my project?
Plz check attached file. Very thanks.
OK , use the attached module , it will do the task
Very thanks Mr Mohammad. I need you for some projects. Do you have PayPal account? Tnx.
You are welcome , I don't have a paypal account , why ?Quote:
Originally Posted by Yoosha
You don't think about renting me , I don't work as a developer I study medicine , developing is just a hobby.
But you can get free help here and at other vb forums.
Btw : Mark this thread as Resolved if my module work with you on vista.
Ok, Mr Mohammad. Do you can create application to set the master sound volume and mute on Windows Vista?
Thanks again.
Try the attached project , I don't have vista so you must try it by yourself.
Note : For each different question make a new thread (after searching) to make it easy for other ppl to search & easy for search engines to index the place.
Edit : this project made by the KPD team : http://allapi.mentalis.org/
mr yoosha i think that u r from usa, msayed2004 isn' asking for :afrog: money
i'm a new member here & i'm glad to be right here, i'm from egypt too
and ................
it's enough today
good bye
Hi,
I'm not shure what to modify. I only need a single .BAS module, without the user needing to install anything. Using the common dialog from COGDLG32.OCX is not an option because not all Windows systems have this installed by default. Can you please modify the module to allow it to accept a filename.
Example;
Public Function SetWallpaper(ImagePath As String, FileName As String, Position As String) As Boolean
Thanks
Kind regards,
Heraut
P.S.
Second, why do you only allow BMP wallpapers? Vista uses JPG, GIF, PNG, etc.
As I said in my PM , no need to change that module just pass the FULL path of the image to that module eg :
vb Code:
SetWallpaper "c:\img.bmp", Center
About the BMP issue as I said before I don't have windows vista so I don't know much about it , in older versions of windows this code will mainly work with BMP only so I restricted other types.
Edit : I attached an example that does not use the common dialog ocx , just APIs.
Ok, Plz see this picture:Quote:
Originally Posted by msayed2004
Strange , vista added your project as an item in the Volume mixer , I am not sure if I can think about something I have no idea about so I suggest that you make a web search or wait until another vista user try it.
Sorry for this :(
Ok, Thanks. But about wallpaper i need a function like the one below:
Function SetWallpaper(ImagePath As String, FileName As String, Position As String) As Boolean
? Tnx.
Why ?
I need code of function that allows me to switch the wallpaper in Vista. thanks. :)