右健->属性->Web->在活动桌面显示Web页->新建->选择html->既可以设置桌面为Web页
请问用程序怎么实现该功能,修改后要求及时刷新

解决方案 »

  1.   

    ...show/hide the ActiveDesktop?  
    Autor: Thomas Stutz  
    [Write new comment] 
    [ Print tip ]     Tip Rating (6):   
          
    uses
      ComObj, ShlObj, ActiveX;procedure EnableActiveDesktop(bValue: Boolean);
    const
      CLSID_ActiveDesktop: TGUID = (D1: $75048700; D2: $EF1F; D3: $11D0;
        D4: ($98, $88, $00, $60, $97, $DE, $AC, $F9));
    var
      MyObject: IUnknown;
      ActiveDesk: IActiveDesktop;
      twpoComponentOpt: TComponentsOpt;
    begin
      MyObject := CreateComObject(CLSID_ActiveDesktop);
      ActiveDesk := MyObject as IActiveDesktop;
      with twpoComponentOpt do
      begin
        ZeroMemory(@twpoComponentOpt, SizeOf(TComponentsOpt));
        dwSize := SizeOf(twpoComponentOpt);
        fEnableComponents := bValue;
        // fActiveDesktop := True;
      end;
      ActiveDesk.SetDesktopItemOptions(twpoComponentOpt, 0);
      ActiveDesk.ApplyChanges(AD_APPLY_ALL);
    end;
     
      

  2.   

    怎么实现阿
    假如我要把桌面设置成G:\123.htm,应该怎么实现
    假如我要把桌面设置成www.sohu.com,应该怎么实现
      

  3.   

    参考这里:http://www.nssoft.net/showdoc.asp?did=736
      

  4.   

    uses ShlObj, ComObj;
     
    procedure SetWallpaper(WallpaperPath: String);
    const
      CLSID_ActiveDesktop: TGUID = '{75048700-EF1F-11D0-9888-006097DEACF9}';
    var
      ActiveDesktop: IActiveDesktop;
      ComponentsOpt: TComponentsOpt;
      WStr : PWideChar;
    begin
      WStr := AllocMem(MAX_PATH);
      try
        StringToWideChar(WallpaperPath, WStr, MAX_PATH);
        ActiveDesktop := CreateComObject(CLSID_ActiveDesktop) as IActiveDesktop;
        ComponentsOpt.dwSize := sizeOf(ComponentsOpt);
        ActiveDesktop.GetDesktopItemOptions(ComponentsOpt,0);
        ComponentsOpt.fActiveDesktop := true;      //启动ActiveDesktop
        ActiveDesktop.SetDesktopItemOptions(ComponentsOpt,0);
        ActiveDesktop.SetWallpaper(WStr, 0);
        ActiveDesktop.ApplyChanges(AD_APPLY_ALL);   //储存设定
      finally
        FreeMem(wstr);
      end;
    end;
      

  5.   

    难道无人能解,Csdn真的没有高手,全是来混的玩的???????????????????
      

  6.   

    倒。楼主好能发帖子。我在VC和BCB区都给你回答了。:D
      

  7.   

    procedure TForm1.Button4Click(Sender: TObject);
    const
      CLSID_ActiveDesktop: TGUID = (D1: $75048700; D2: $EF1F; D3: $11D0;D4: ($98, $88, $00, $60, $97, $DE, $AC, $F9));
    var
      twpoComponentOpt : TComponentsOpt;
      ActiveDesktop : IActiveDesktop;
      Buffer : Array [0..1000]of WideChar;
      Addr : String;
      Endereco : PWideChar;
      WallpaperOptions : TWallpaperOpt;
    begin
      ActiveDesktop := CreateComObject(CLSID_ActiveDesktop) as IActiveDesktop;  with twpoComponentOpt do
        begin
          ZeroMemory(@twpoComponentOpt, SizeOf(TComponentsOpt));
          dwSize := SizeOf(twpoComponentOpt);
          fEnableComponents := True;
          fActiveDesktop := True;
        end;
      ActiveDesktop.SetDesktopItemOptions(twpoComponentOpt, 0);
      ActiveDesktop.ApplyChanges(AD_APPLY_ALL);  WallpaperOptions.dwStyle := WPSTYLE_STRETCH;
      WallpaperOptions.dwSize := SizeOf(WallpaperOptions);
      ActiveDesktop.SetWallpaperOptions(WallpaperOptions, 0);
      Addr := 'e:\books.html';//'http:////community.csdn.net//expert//forum.asp';
      Endereco := StringToWideChar(Addr,Buffer,Length(Addr) + 1);
      ActiveDesktop.SetWallpaper(Endereco,0);
      ActiveDesktop.ApplyChanges(AD_APPLY_ALL or AD_APPLY_FORCE);
    end;上面的代码,设置本地的 html 是可以的,但设置其它网站的链接,还有问题