Ver Mensaje Individual
  #5  
Antiguo 01-10-2004
bustio bustio is offline
Miembro
 
Registrado: oct 2003
Posts: 231
Reputación: 21
bustio Va por buen camino
Respondiendo a mi mismo

Hola Comunidad!!!

Despues de analizar mi problema para cambiar un desktop en RunTime programe esto: aqui les mandoe lcodigo.. espero que les sea util
GRACIAS!!


procedure TfrmPrincipal.CabiarWallpaper;
var
Tapiz, Addr: String;
Cant : Integer;
Num : Integer;

ActiveDesktop : IActiveDesktop;
Buffer : Array [0..1000]of WideChar;
Direccion : PWideChar;

begin
Cant := ListaFicheros.Items.Count;
If Aleatorio = False then
begin
inc(TapizActual);
Try
Tapiz := ListaFicheros.Items.Item[TapizActual].Caption;
Addr := edtCamino.Text + '\' + Tapiz;
ActiveDesktop := CreateComObject(CLSID_ActiveDesktop) as IActiveDesktop;
Direccion:= StringToWideChar(Addr,Buffer,Length(Addr)+1);
ActiveDesktop.SetWallpaper(Direccion,0);
ActiveDesktop.ApplyChanges(AD_APPLY_ALL or AD_APPLY_FORCE);
Except
End;
end
else
begin
Randomize;
Num := Random(Cant -1);
While ((Num) > Cant) or ((Num) < 0) do
begin
Num := Random(Cant -1);
end;
Try
Tapiz := ListaFicheros.Items.Item[Num].Caption;
Addr := edtCamino.Text + '\' + Tapiz;
ActiveDesktop := CreateComObject(CLSID_ActiveDesktop) as IActiveDesktop;
Direccion:= StringToWideChar(Addr,Buffer,Length(Addr)+1);
ActiveDesktop.SetWallpaper(Direccion,0);
ActiveDesktop.ApplyChanges(AD_APPLY_ALL or AD_APPLY_FORCE);
Except
End;
end;
end;
Responder Con Cita