Thursday, March 29, 2007

XPe tip #6: Completely hide the Taskbar

On embedded XP we often (almost always) want to customize shell UI. The best way to do that is to get rid of Explorer shell and implement your own custom shell application. But if you don't have enough skills to write often a complex application, or you simply don't have enough time to do so, or, worse, Explorer shell must be running in order to get some functionality out of the box. Many examples to this have been posted to the XPe newsgroup, e.g. Autoplay feature.
So, what if you must have Explorer shell running but you still have to lock down OS and avoid users messing with files on disk and etc.
You can always have your own application running in full screen mode and covering all other windows from Microsoft (Desktop, Taskbar, etc.). But we all know that even with a proper Group Policy setup you won't be able to completely hide everything. There may also be cases where Taskbar will be showing up on the top of all other windows in the system regardless of the system settings. Only cure is to get control in your hands and completely hide the Taskbar (no, don't kill it - you still need Explorer's functionality). Here the tricks I came up with for hiding Taskbar.

First of all, lets pre-setup in TD the auto-hiding behaviour of the Taskbar. Although it sounds easy - just set the right registry flag - but it is not. For most Taskbar and some Start Menu options the Explorer keeps the settings stored as a set of bits in some registry values. Certainly, those bits are not documented. No problem, we always have helpful Regmon and by spending a little bit of time you'll figure out the interesting registry entry is [HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2],"Settings". As I mentioned earlier, it is a binary structure. Long time ago I posted a script on xpefiles.com that changed the right bits of that value to make the Taskbar auto-hiding enabled. The readme of that posting would explain how to launch the script properly and set it up in TD.

Now lets go deeper and just disable the Taskbar once and for all.
What you want to do here is just create and compile a simple app that makes a call to FindWindow() on "Shell_TrayWnd" window class name and then just do a ShowWindow(SW_HIDE) for this window handle. The same you should do with "Progman" and Desktop windows. You better also disable the windows (EnableWindow(FALSE)) before hiding.

I actually do have this app written. The code is far from bring production quality (it was just an experiment, after all!) but I will share it with you, folks, as soon as I get my hands on that drive (I took it out and put it on a shelf here quite a while ago). Will do that very soon, I think.

2 comments:

Unknown said...

Hello, I am trying to locate your script which hides the taskbar on xpefiles.com. But it seems the link to that script is broken. Could you please email it to kenz@axiomtek.com? Much appreciated. Thanks.

Anonymous said...

When I start my post-FBA image, the Start Menu appears and has focus. I dont want it to.

Any idea why the start menu is activated on startup?