Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to change the desktop wallpaper? Posted by earth_walker on 8 Jul 2003 at 8:36 PM
Hi! According to the windows SDK help file, I use the following command to change the wall paper. I traced it and made sure the file 'c:\Vinca.jpg' exists, but after running it, the wall paper doesn't change(still no wall paper).

Can you tell me how to change it?

Thank you!

if FileExists('c:\Vinca.jpg') then
    SystemParametersInfo(SPI_SETDESKWALLPAPER, 0,
    PChar('c:\Vinca.jpg'), 0);

Report
Re: How to change the desktop wallpaper? Posted by pak77 on 9 Jul 2003 at 8:31 AM
: Hi! According to the windows SDK help file, I use the following command to change the wall paper. I traced it and made sure the file 'c:\Vinca.jpg' exists, but after running it, the wall paper doesn't change(still no wall paper).
:
: Can you tell me how to change it?
:
: Thank you!
:
:
: if FileExists('c:\Vinca.jpg') then
:     SystemParametersInfo(SPI_SETDESKWALLPAPER, 0,
:     PChar('c:\Vinca.jpg'), 0);
: 

:
Hi, the reason the wallpaper doesn't change is that the wallpaper image has to be in "bmp" format and not a "jpg" image.

Report
Re: How to change the desktop wallpaper? Posted by earth_walker on 9 Jul 2003 at 9:02 AM
Thank you! I use a .bmp file and change the wallpaper successfully.

I got a further question is that why it cannot be .jpg? Because I tried to select a .jpg file in "Windows Display Properities" run by right clicking desktop, and it still works.

Thank you!

Report
Re: How to change the desktop wallpaper? Posted by Manning on 9 Jul 2003 at 6:28 PM
: Thank you! I use a .bmp file and change the wallpaper successfully.
:
: I got a further question is that why it cannot be .jpg? Because I tried to select a .jpg file in "Windows Display Properities" run by right clicking desktop, and it still works.

It can be .jpg, but it is much more complicated. The simple solution is to take the .jpg and convert it to a .bmp, and then set it as the wallpaper. But if you want to learn how to do it the other way, it was recently discussed on the C++ programming board so you could take a look there.
Report
Re: How to change the desktop wallpaper? Posted by earth_walker on 9 Jul 2003 at 6:43 PM
Thank you!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.