Results 1 to 5 of 5

Thread: wallpaper and screen saver

  1. #1

    Thread Starter
    Hyperactive Member snakeman's Avatar
    Join Date
    Aug 2006
    Posts
    351

    Unhappy wallpaper and screen saver

    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:
    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_SETSCREENSAVETIMEOUT = 15
    Const SPI_SETSCREENSAVEACTIVE = 17
    Const SPI_SETDESKWALLPAPER = 20
    Const SPIF_UPDATEINIFILE = &H1

    Sub screen()
    SystemParametersInfo SPI_SETSCREENSAVEACTIVE, True, cdl.FileName, SPIF_UPDATEINIFILE
    End Sub

    Sub wallpaper()
    SystemParametersInfo SPI_SETDESKWALLPAPER, 0, cdl.FileName, SPIF_UPDATEINIFILE
    End Sub

    Private Sub cmdscreen_Click()
    cdl.Filter = "screen|*.scr"
    cdl.ShowOpen
    screen
    End Sub

    Private Sub cmdwallpaper_Click()
    cdl.Filter = "bmp|*.bmp"
    cdl.ShowOpen
    wallpaper
    End Sub

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: wallpaper and screen saver

    To change the current screen saver it's not an API call you need like that. I think it's slightly different depending on the OS version. But it's more the style of changing an ini file or the registry.


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: wallpaper and screen saver



    Has someone helped you? Then you can Rate their helpful post.

  4. #4

    Thread Starter
    Hyperactive Member snakeman's Avatar
    Join Date
    Aug 2006
    Posts
    351

    Re: wallpaper and screen saver

    man
    this thread http://www.vbforums.com/showthread.php?t=426274 is mine too
    cause i wrote it twice
    once here in API FORUMS
    and second in VB Classic forum
    but thx anyway

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: wallpaper and screen saver

    Didn't notice the dates or the poster... I guess this is proof why people shouldn't post in more than one forum?


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width