VB.NET, changer le fond d'écran avec une URL.

Ordibug? Messages postés 105 Date d'inscription   Statut Membre Dernière intervention   -  
thepolienniste Messages postés 15 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour !
J'aimerais faire un p'tit tool pour changer le fond d'écran de l'ordinateur avec une URL de l'image.
J'ai déjà réussi à coder ça :

Imports System.IO
Public Class Form1
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer

Public Sub SetWallpaper(ByVal Path As String)
Try
SystemParametersInfo(20, 0, Path, &H1)
Catch
End Try
End Sub


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

SetWallpaper("chemin de l'image....")
End Sub
End Class




Ca marche, mais j'ai même essayé avec une variable en string en y mettant l'URL de l'image et ça marche pas :(

donc voilà, merci d'av.
A voir également:

1 réponse

thepolienniste Messages postés 15 Date d'inscription   Statut Membre Dernière intervention   3
 
Bonsoir,

il suffit de télécharger temporairement l'image voulue ;)
My.Computer.Network.DownloadFile(tonUrl,DossierQuiRecevraLImage)
SetWallpaper(DossierQuiRecevraLImage)
0