如何用delhpi程序改变win xp桌面墙纸?
各位贤者快给我答复吧
thank you!

解决方案 »

  1.   

    http://topic.csdn.net/t/20030812/18/2138551.html
      

  2.   


            Reg:=TRegistry.Create;
            Reg.RootKey:=HKEY_CURRENT_USER;
            Reg.OpenKey('\Control Panel\Desktop',False);
            Reg.WriteString('TileWallpaper','0');
            Reg.WriteString('WallPaperStyle','0');
            Reg.WriteString('Wallpaper',NewFile);
            Reg.CloseKey;
            Reg.Free;
            SystemParametersInfo(SPI_SETDESKWALLPAPER,0,nil,SPIF_SENDCHANGE + SPIF_UPDATEINIFILE);
      

  3.   


    uses
      Shlobj;procedure SetWallPaper(StrFile: String; Style: Integer);  //StrFile: 图片文件名
    Var
      DT: IActiveDesktop;
      WPO: TWallpaperOpt;
      WS: WideString;
    Begin
      DT := CreateComObject(CLSID_ActiveDesktop) As IActiveDesktop;
      WS := StrFile;
      Case Style Of
        0: WPO.dwStyle := WPSTYLE_CENTER;    {居中}
        1: WPO.dwStyle := WPSTYLE_TILE;      {平铺}
        2: WPO.dwStyle := WPSTYLE_STRETCH;   {拉伸}
      Else
        WPO.dwStyle := WPSTYLE_CENTER;
      End;
      WPO.dwSize := SizeOf(WPO);
      DT.SetWallpaperOptions(WPO, 0);
      DT.SetWallPaper(PwideChar(WS), 0);
      DT.ApplyChanges(AD_APPLY_ALL);end;
      

  4.   


    uses
      Shlobj;procedure SetWallPaper(StrFile: String; Style: Integer);  //StrFile: 图片文件名
    Var
      DT: IActiveDesktop;
      WPO: TWallpaperOpt;
      WS: WideString;
    Begin
      DT := CreateComObject(CLSID_ActiveDesktop) As IActiveDesktop;
      WS := StrFile;
      Case Style Of
        0: WPO.dwStyle := WPSTYLE_CENTER;    {居中}
        1: WPO.dwStyle := WPSTYLE_TILE;      {平铺}
        2: WPO.dwStyle := WPSTYLE_STRETCH;   {拉伸}
      Else
        WPO.dwStyle := WPSTYLE_CENTER;
      End;
      WPO.dwSize := SizeOf(WPO);
      DT.SetWallpaperOptions(WPO, 0);
      DT.SetWallPaper(PwideChar(WS), 0);
      DT.ApplyChanges(AD_APPLY_ALL);end;
      

  5.   


    uses
      Shlobj;procedure SetWallPaper(StrFile: String; Style: Integer);  //StrFile: 图片文件名
    Var
      DT: IActiveDesktop;
      WPO: TWallpaperOpt;
      WS: WideString;
    Begin
      DT := CreateComObject(CLSID_ActiveDesktop) As IActiveDesktop;
      WS := StrFile;
      Case Style Of
        0: WPO.dwStyle := WPSTYLE_CENTER;    {居中}
        1: WPO.dwStyle := WPSTYLE_TILE;      {平铺}
        2: WPO.dwStyle := WPSTYLE_STRETCH;   {拉伸}
      Else
        WPO.dwStyle := WPSTYLE_CENTER;
      End;
      WPO.dwSize := SizeOf(WPO);
      DT.SetWallpaperOptions(WPO, 0);
      DT.SetWallPaper(PwideChar(WS), 0);
      DT.ApplyChanges(AD_APPLY_ALL);end;
      

  6.   


    uses
      Shlobj;procedure SetWallPaper(StrFile: String; Style: Integer);  //StrFile: 图片文件名
    Var
      DT: IActiveDesktop;
      WPO: TWallpaperOpt;
      WS: WideString;
    Begin
      DT := CreateComObject(CLSID_ActiveDesktop) As IActiveDesktop;
      WS := StrFile;
      Case Style Of
        0: WPO.dwStyle := WPSTYLE_CENTER;    {居中}
        1: WPO.dwStyle := WPSTYLE_TILE;      {平铺}
        2: WPO.dwStyle := WPSTYLE_STRETCH;   {拉伸}
      Else
        WPO.dwStyle := WPSTYLE_CENTER;
      End;
      WPO.dwSize := SizeOf(WPO);
      DT.SetWallpaperOptions(WPO, 0);
      DT.SetWallPaper(PwideChar(WS), 0);
      DT.ApplyChanges(AD_APPLY_ALL);end;
      

  7.   

    不好意思,刷了几次屏,是试验插入Delphi风格的代码.