• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Changing wallpaper

I made a small program that will change wallpaper randomly when windows starts. I put the program in Run-section in the registry. Now when windows starts, it will change wallpaper, but before it does it I can still see the old wallpaper.

How can I change the wallpaper on start-up without seeing old wallpaper?
0
tonitop
Asked:
tonitop
  • 2
1 Solution
 
EpsylonCommented:
Use this:

  SystemParametersInfo(SPI_SETDESKWALLPAPER,
                       0,
                       PChar('Image.bmp'),
                       SPIF_SENDWININICHANGE);

Cheers,

Epsylon.

0
 
tonitopAuthor Commented:
I already know how to change wallpaper, but when I run my program (I have it in windows registry under Run-section) it changes wallpaper after start-up, so I can still see the old wallpaper when windows starts. If there a way to change the wallpaper on start-up so that it would be changed before I can see my desktop?
0
 
EpsylonCommented:
Change it when windows shuts down....
0
 
simonetCommented:
Unless you're doing like Epsylon suggested, then the answer is "NO". That's because the desktop (EXPLORER.EXE) is loaded and run before any other applications.

You can try loading your application as a service, by placing it in:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices

There's a chance services are loaded before other applications are, but I cannot asure you that services are loaded before the desktop. Anyway it's worth a try.

If that doesn't work, then changing the wallpaper right before Windows shutdown is the only possible solution.

yours,

Alex
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now