FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
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; |
|
|
|