vb中更换桌面的问题
我想写一个更换桌面壁纸的程序,我的程序如下:
函数声名:
Declare Function SystemParametersInfo& Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long)
Declare Function SystemParametersInfoByVal& Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long)
Public Const SPI_SETDESKWALLPAPER = 20
Public Const SPIF_UPDATEINIFILE = &H1
Public Const SPIF_SENDWININICHANGE = &H2
*************************
n = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "e:\1.BMP", SPIF_UPDATEINIFILE + SPIF_SENDWININICHANGE) '调用函数,更换桌面背景
MsgBox n
结果N返回0.....
上面的代码错误的地方在哪里?请给出正确的代码,谢谢!