|
-
Dec 15th, 1999, 07:46 PM
#1
Thread Starter
_______
trying to change wallpaper in windows
Ihave my module which has 2 api calls
one for win path the other for systemparametersinfo
SPI_SETDESKWALLPAPER = 20
I have set the path Rivetspath & point to a bmp in the windsows file Rivets.bmp
I understand things up to here...
retval = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, ByVal Rivetspath, SPIF_SENDWININICHANGE Or SPIF_UPDATEINIFILE)
================================
here is what I don't understand
What are SPIF_SENDWININICHANGE Or SPIF_UPDATEINIFILE)
Do I have to make declares for these?
Do I have to do anything for these?
I msgbox for display and I get the correct path and retval=1 but that is it..no change.
-
Dec 15th, 1999, 08:31 PM
#2
The last parameter in your API call tells windows to update a Win.ini (using these 2 constants SPIF_SENDWININICHANGE and SPIF_UPDATEINIFILE) with the new path of your wallparper.
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Dec 15th, 1999, 08:46 PM
#3
Thread Starter
_______
Serge: that means I don't they are just do their thing?
Here is the code I have so far but it does nothing....help!
'module code
Public Declare Function GetWindowsDirectory _
Lib "kernel32" Alias "GetWindowsDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
Public Const SPI_SETDESKWALLPAPER = 20
'form event code
' Set the desktop wallpaper to the Rivets.bmp that comes with Windows.
' Note how the string passed to the function is preceeded by the ByVal keyword.
Dim windir As String ' receives the path of the Windows directory
Dim Rivetspath As String ' filename of rivets.bmp
Dim retval As Long ' return value
' Get the path of the Windows directory.
windir = Space(255) ' make room in the buffer
retval = GetWindowsDirectory(windir, 255) ' get the path name
windir = Left(windir, InStr(windir, vbNullChar) - 1) ' trim the null character and unused characters
Rivetspath = windir & "\" & "Rivets.bmp" ' add the filename to the path
' Set the Windows wallpaper, saving the change and notifying all programs
retval = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, ByVal Rivetspath, SPIF_SENDWININICHANGE Or SPIF_UPDATEINIFILE)
-
Dec 15th, 1999, 09:06 PM
#4
Yes, it tells that when the system changes the wallpaper, it also changes the Win.INI file, so the next time windows start, this wallpaper would be loaded as well. And yes, it doesn't have to be handled yourself.
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Dec 15th, 1999, 09:49 PM
#5
Thread Starter
_______
It should..but it does nothing..anyone have time to try it on their machine.
I use vb6 win98
Thanks,
Wayne
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
|