![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
||||
|
||||
|
Cita:
Deberás añadir al uses: ComObj y ShlObj
__________________
Germán Estévez => Web/Blog Guía de estilo, Guía alternativa Utiliza TAG's en tus mensajes. Contactar con el Clubdelphi ![]() P.D: Más tiempo dedicado a la pregunta=Mejores respuestas. |
|
#2
|
|||
|
|||
|
Cambiar el Walpaper en RunTime
ActiveDesktop.SetWallpaper('c:\winnt\Azteca.bmp', 0);
La funcion que me diste cambia mi Tapiz de maravillas!!! Siempre que se le pase como parametros una direccion propiamente dicha. Muchas gracias!!! Ahora el detalle esta en que esa direccion debe ser un PWideChar, no un string o un TCaption. Ahora necesito saber que hacer para que esta funcion soporte un String.. Probe con hacerle un casting a mi direccion string(PWideChar(Address)) pero no funciona. Me pudieran ayudar ahora con esta nueva incognita? GRACIAS |
|
#3
|
||||
|
||||
|
¿Has probado PChar(Str)?
__________________
Germán Estévez => Web/Blog Guía de estilo, Guía alternativa Utiliza TAG's en tus mensajes. Contactar con el Clubdelphi ![]() P.D: Más tiempo dedicado a la pregunta=Mejores respuestas. |
|
#4
|
|||
|
|||
|
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; |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
|