Can u trace any flaw in this code ?
can anyone trace what is wrong with this code..(in vb .net)
i can't remember the windows generated form code..so plz ignore that..
plz see the actual code ,not the generated one..
1)the function called returns true
2) err.lastdllerror = 0
but still the desktop wallpaper is not changed..
i have worked out this code in c++ and visual c++ n it runs perfectly..
but i want to do it in vb.net..
vb .net code->> imports system.IO windows generated form code .. 'winapi call fron user32.dll library Private Sub Button1_Click( _
public class form1
inherits system.forms.form
' U can take any bitmap file..
dim a as string = "c:\(any file).bmp"
dim b as long
Private Const SPI_SETDESKWALLPAPER = 20
Private Const SPIF_SENDWININICHANGE = &H2
Private Const SPIF_UPDATEINIFILE = &H1
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As string, ByVal fuWinIni As Long) As Long
'button 1 event handler..
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
b = systemparametersinfo(SPI_SETDESKWALLPAPER,0,a,SPIF_UPDATEINIFILE )
msgbox(b.tostring)
msgbox(err.lastdllerror)
end sub
end class

