Registry Set Background

  • Thread starter Thread starter Harry Simpson
  • Start date Start date
H

Harry Simpson

I've written a section of .REG file that does assign the background picture
to the file I designate but the picture doesn't actually display - instead
it's just a blank background.....is there someway to do a doevents type deal
that would make the background display after it's changed??

;Sets the background image
[HKEY_CURRENT_USER\Software\Microsoft\Today]
"WallFile"="\windows\tdycust.jpg"
"Wall"="Eidlablgbg"
"Skin"=""
"Watermark"="tdycust.jpg"

TIA
Harry
 
Probably, you have to send a WM_SETTINGCHANGE to the desktop window. To be
sure, there are two things that you might do:

1. PostMessage( HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETDESKWALLPAPER,
0 );

2. HWND hwnd = FindWindow( _T( "DesktopExplorerWindow" ), 0 );
if ( hwnd )
{
#define ID_WALLPAPAER 1001
#define ID_TILEWALLPAPER 1105
PostMessage( hwnd, WM_COMMAND, ID_TILEWALLPAPER, (LPARAM)fTile );
PostMessage( hwnd, WM_COMMAND, ID_WALLPAPAER, (LPARAM)0 );
}

Obviously, you'll have to port this to managed code, but most of the
declarations are in OpenNETCF already.

Paul T.
 
Back
Top