Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hi, i want to write a program to c 1

Status
Not open for further replies.

vkarthik

Programmer
Aug 30, 2001
126
US
hi, i want to write a program to change the wallpaper immediately when some button is clicked. i use vc++. does any 1 know a function call or registry tweak to do this.
 
I would think if you knew the registry key then CRegKey would be the way to go... Just call SetKeyValue of the key containing the path to the bitmap

Matt
 
or, you can use IActiveDesktop::Set(Get)Wallpaper... This shoud do the trick if you're using MFC...

But, if you are more in Windows api, a call to SystemParametersInfo function, with uiAction parameter set to SPI_SETDESKWALLPAPER and the pvParam set to a string pointing to the location of the bitmap.
You should check MSDN for a complete reference about this function... [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
 
thats a great tip, but could u tell me the header file of IActiveDesktop (hope it comes along with standard vc++ installation). i tried SystemParametersInfo & it worked but how do i refresh the desktop window so that it changes to the new wallpaper. plz help!!!.
 
i got 1 more doubt, is it not possible to give jpeg filename in SystemParameterInfo. it changes only 4 bmp.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top