Salut tous, je viens demander conseil a des spécialiste de visual basic .net. J'ai fait un programme qui change le wallpaper de Windows (jusque la rien d'exeptionnelle), j'utilise donc la fonction SystemParametersInfo que j'ai importer de la dll user32.dll. Ca compile nikel mais ca ne change pas le fond d'écran.
Voila le source:
'j'inclus la dll user32.dll '<DllImport("User32.dll", EntryPoint:="SystemParametersInfo", _ 'SetLastError:=True, CharSet:=CharSet.Auto, _ 'CallingConvention:=CallingConvention.StdCall)> _ 'Public Shared Function Change_Wallpaper(ByVal uiAction As Long, _ 'ByVal uiParam As Long, ByRef pvParam As Any, ByVal fWinIni As Long) 'Cette fonction change le fond d'écran (Wallpaper) de Windows. 'elle fait un apelle à la fonction SystemParametersInfo dans la dll User32.dll 'BOOL SystemParametersInfo( UINT uiAction, UINT uiParam, _ 'PVOID pvParam, UINT fWinIni); 'End Function
Declare Function SystemParametersInfo Lib "user32.dll" Alias "SystemParametersInfoA" ( _ ByVal uAction As Long, _ ByVal uParam As Long, _ ByRef lpvParam As String, _ ByVal fuWinIni As Long) As Long
' ici j'apelle la fonction SystemParametersInfo: fichier = "D:\\Images\\Synthèse\\@.bmp" SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, fichier, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
|
Le bureau se rafraichis, mais le fond d'écran reste le même, J'ai essayer la fonction SystemParametersInfo avec visual c++ en utilisant la même syntaxe ca passe. Je capte pas pouquoi avec vb .net sa ne fait rien.
merci de votre aide.