procedure ChangeWallPaper(BmpFile: String);<br>//更改墙纸<br>var<br> Reg: TRegistry;<br>begin<br> Reg:=TRegistry.Create;<br> Reg.RootKey:=Hkey_Current_User;<br> Reg.OpenKey('Control Panel/Desktop', False);<br> Reg.WriteString('Wallpaper', BmpFile);<br> Reg.WriteString('TileWallpaper', '1'); //( 1-平铺 0-居中 2-拉伸)<br> SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, nil, SPIF_UPDATEINIFILE);<br> SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETDESKWALLPAPER, 0);<br> Reg.CloseKey;<br> Reg.Free;<br>end;