hi i am new in API and i dont know what is the wrong with this code ??
the wallpaper is working only on bmp file format and i tried jpg and it didn't work.
and to the screen saver it didn't work at all.
this is the code:
VB Code:
  1. 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
  2.  
  3. Const SPI_SETSCREENSAVETIMEOUT = 15
  4. Const SPI_SETSCREENSAVEACTIVE = 17
  5. Const SPI_SETDESKWALLPAPER = 20
  6. Const SPIF_UPDATEINIFILE = &H1
  7.  
  8. Sub screen()
  9. SystemParametersInfo SPI_SETSCREENSAVEACTIVE, True, cdl.FileName, SPIF_UPDATEINIFILE
  10. End Sub
  11.  
  12. Sub wallpaper()
  13. SystemParametersInfo SPI_SETDESKWALLPAPER, 0, cdl.FileName, SPIF_UPDATEINIFILE
  14. End Sub
  15.  
  16. Private Sub cmdscreen_Click()
  17. cdl.Filter = "screen|*.scr"
  18. cdl.ShowOpen
  19. screen
  20. End Sub
  21.  
  22. Private Sub cmdwallpaper_Click()
  23. cdl.Filter = "bmp|*.bmp"
  24. cdl.ShowOpen
  25. wallpaper
  26. End Sub