Je voudrais écrire une petite application Windows qui change le fond d'écran à partir de photos récupérées sur un service web? Comment dois-je m'y prendre? Quelle langue/technologie serait-elle la plus rapide à coder?Comment écrire une application Windows pour changer le fond d'écran?
2
A
Répondre
3
Il y a aussi un exemple de code en C# et VB here. En plus d'appeler SystemParametersInfo, il définit également les clés reg pour tile et style.
1
trouvé ce (vb) Code sur le net:
Private Const SPI_SETDESKWALLPAPER As Integer = &H14
Private Const SPIF_UPDATEINIFILE As Integer = &H1
Private Const SPIF_SENDWININICHANGE As Integer = &H2
Private Declare Auto Function SystemParametersInfo Lib "user32.dll" (ByVal uAction As Integer,_
ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer
' change this to whatever filename you want to use'
Const WallpaperFile As String = "MovieCollectionImage.bmp"
''' <summary>
''' Sets the background of your Windows desktop. The image will be saved in MyPictures_
and the background wallpaper updated.
''' </summary>
''' <param name="img">The image to be set as the background.</param>
''' <remarks></remarks>
Friend Sub SetWallpaper(ByVal img As Image)
Dim imageLocation As String
imageLocation = My.Computer.FileSystem.CombinePath_
(My.Computer.FileSystem.SpecialDirectories.MyPictures, WallpaperFile)
Try
img.Save(imageLocation, System.Drawing.Imaging.ImageFormat.Bmp)
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, imageLocation,_
SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
Catch Ex As Exception
MsgBox("There was an error setting the wallpaper: " & Ex.Message)
End Try
End Sub
Appelé comme:
SetWallpaper (Me.PictureBox1.Image)
Questions connexes
- 1. Windows Problème mobile fond application
- 2. Comment puis-je écrire une application Windows sans utiliser WinMain?
- 3. Comment changer le focus dans X-Windows?
- 4. KDE4.2 changer de fond d'écran
- 5. Puis-je écrire une application .aspx sur Windows XP?
- 6. Changer l'image de fond avec jQuery
- 7. Comment écrire une application Silverlight hors ligne?
- 8. Comment créer une commande de désinstallation pour une application Windows dans le dossier Application
- 9. WPF C# - Changer la brosse de fond
- 10. comment changer la couleur de fond d'en-tête de colonne pour le contrôle AdvancedDataGrid flex
- 11. Comment changer la couleur de fond d'un NSBrowser de cacao?
- 12. Meilleur langage de programmation pour écrire une application Gestionnaire de fichiers Windows
- 13. Quand écrire une application Web et quand écrire une application de bureau?
- 14. Comment enregistrer un raccourci clavier personnalisé pour une application Windows
- 15. Références pour apprendre à écrire une application multithread en C#?
- 16. Quelles sont les approches pour écrire une application d'horloge simple?
- 17. Comment faire pour avancer le diaporama de fond d'écran sur Windows Vista/7 par programmation?
- 18. Comment déployer une application Qt sous Windows?
- 19. écrire une application iPhone avec vidéo intégrée
- 20. Requête Windows pour si une application est installée par UpgradeCode
- 21. Comment changer le DPI d'une partie d'une application WPF/Silverlight?
- 22. Écrire une application Facebook en JavaScript
- 23. tâche de fond avec une application web asp.net
- 24. Comment vous étirer une image de fond
- 25. Changer la couleur de fond de nuage de tags
- 26. Comment écrire un fichier batch pour désinstaller une application et en installer une nouvelle version?
- 27. Choix des polices pour une application Windows Forms
- 28. Comment changer XIB dans une application de barre d'onglets?
- 29. Comment créer une application qui écoute les événements Windows?
- 30. Comment écrire un IThumbnailProvider fonctionnel pour Windows Vista
dans Windows 7, vous pouvez le faire via un flux rss – Lodle