Monday, 1 December 2008

Substitute the Desktop Background Graphics

Well, how to customize the background image on Windows CE Desktop?

I've seen quite a few times now and it seemed the most intuitive way for me, too, to first search for the background image file coming from Microsoft. But what to do then?

1.) First alternative coming to everybody's mind is to substitute the background image file. The file is named windowsce_vgal.jpg and is placed in _PLATFORMROOT\<BSPNAME>\Files After testing you hopefully have IMAGING_IMG_JPEGDECODER enabled, too. Otherwise you will find out that there is a windowsce_vgal.bmp that has to be sustituted then. This was quite easy but since you used the same file naming in your project compared to Microsoft's original file naming it's hard to see or recognize that the substitution took place. Especially if you'll just look at the sources a few month after the changes. Then you'll really need an image viewer to recognize the replaced images.

So is there a better way to do this?

2.) Watch out for the shell.bib file. There you will find the lines controling the inclusion of the background image like:

; @CESYSGEN IF SHELL_MODULES_VGAL
; @CESYSGEN IF IMAGING_IMG_JPEGDECODER
WindowsCE.jpg $(_FLATRELEASEDIR)\windowsce_vgal.jpg NK S
; @CESYSGEN ELSE
; @CESYSGEN ENDIF IMAGING_IMG_JPEGDECODER
; @CESYSGEN ENDIF SHELL_MODULES_VGAL

And now look at that: In the final nk.bin image the background image file gets renamed to WindowsCE.jpg

So what you can do here is obviously to add a line like

WindowsCE.jpg $(_FLATRELEASEDIR)\my_projects_background_image.jpg NK S

and probably introduce an own environment variable or feature variable as a catalogue item to wrap this line(s) with some controling IF ELSE ENDIF statements. Now you did not touch the original background image from Microsoft and inside your repository your background image file has a meaningful file name. A few month later looking into your repository you will have a good chance to recognize the customization now.

3.) Now is there a third alternative even better? Why not use your own file name even inside your nk.bin image? So some of your bib files contains, e.g.

my_project_bg_image.jpg $(_FLATRELEASEDIR)\my_projects_background_image.jpg NK S

If you have a look into wceshellfe.reg you will find

; initial value for background bitmap, if any
[HKEY_CURRENT_USER\ControlPanel\Desktop]
; @CESYSGEN IF IMAGING_IMG_JPEGDECODER "wallpaper"="\Windows\WindowsCE.jpg"
; @CESYSGEN ELSE
; @CESYSGEN ENDIF IMAGING_IMG_JPEGDECODER

Adopting the "wallpaper" line to something like

"wallpaper"="\Windows\my_project_bg_image.jpg"

might do the trick then. And again customization control can be added by feature variables and catalogue items. Transparency for others or while time goes by is surely higher compared to the two alternatives before.

Other customization work can often be controled in similar ways...

No comments: