Ver Mensaje Individual
  #9  
Antiguo 24-10-2007
fide fide is offline
Miembro
 
Registrado: oct 2006
Posts: 331
Reputación: 18
fide Va por buen camino
Lightbulb Cambiar la imagen del desktop

Bueno. Aqui una sencilla modificacion del truco anterior, pero no para cambiar el color de fondo. Sino la imagen de fondo pero con ADSI. Esto cambia el fondo del escritorio aunque este restringida esta opcion por el admin de red jejejeje.

Código Delphi [-]
uses ShlObj, ActiveX, ComObj, Registry;

procedure SetDesktopBackgroundImage(vBmpPath: String);
var
  shDesk: IActiveDesktop;
  vWallPOp: TWallPaperOpt;
begin

 try
  shDesk := (CreateComObject(CLSID_ActiveDesktop) as IActiveDesktop);
  shDesk.SetWallpaper(StringToOleStr(vBmpPath), 0);
  vWallPOp.dwSize := Sizeof(TWallPaperOpt);
  vWallPOp.dwStyle := WPSTYLE_TILE;
  shDesk.SetWallpaperOptions(vWallPOp, 0);
  shDesk.ApplyChanges(AD_APPLY_ALL or AD_APPLY_FORCE);
 finally
  FreeObjectInstance(Pointer(shDesk));
 end;

end;

Aqui un ejemplo de uso...

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
begin

  SetDesktopBackgroundImage(ExtractFilePath(Application.ExeName) + 'bmp.bmp');

end;

Última edición por fide fecha: 24-10-2007 a las 15:41:34.
Responder Con Cita