Friday, April 13, 2007

XPe tip #20: Active HTML Desktop

An interesting question recently popped up in the newsgroup about how to get a toolbar working in Active HTML Desktop on XPe.

As you know, on XP if you wanted to set up Desktop to show an HTML page you'd go to -> Properties -> Desktop -> Customize Deskop -> Web page and add a web page (aka component) there with soem setting options assigned. When it was done, your Desktop would show the selected HTML page(s). I always use this feature on my XP machines where I set the IE Home page (typically Google.com) to be the Desktop.

This feature works ok on XPe, of course. However, an issue was reported about the toolbar of the Active Desktop not being popping up.
On XP, that toolbar (a popup that appears on the top of the Desktop when you are hovering mouse cursour over the top of the desktop HTML page) gets disappeared when you have the desktop components locked. As I mentioned, components include the web pages you set for the active desktop. The lock can be set with GUI - just open up Desktop Items dialog (Display -> Properties -> Desktop -> Customize Desktop -> Web) and clear the "Lock desktop items" checkbox at the bottom.

But we are always interested in the registry entries mapped to particular XP features when we have to pre-set those in TD for XPe builds. The HTML Desktop Lock is mapped to
[HKCU\Software\Microsoft\Internet Explorer\Desktop\Components],"GeneralFlags" dword registry value. It is a bit mask and corresponds to a few general options of the page display.

If it is set to "2" (or better say, the second bit set) the desktop items are locked and the toolbar won't be sliding out. You should reset it to 0 if you want the toolbar to appear by mouse hover event.

I am going to update this post with some more information as required to clarify a few things about the ActiveDesktop feature of XP.

First of all, the feature works great on XPProEmulation image. Note that to get it to work there didn't require any custom registry entries to be populated.
A few more tips here:
- Shell32.dll must be in the image. Well, since the feature doens' make sense out of Explorer Shell - Desktop is required - it is almost useless to say the Shell32 is required too.

- Make sure "Primitive: Browseui", "HTML Rendering Engine", "Primitive: Oleaut32" and "Primitive: Shlwapi" components are in your image. Last 3 components are probably in your image already if you resolved Explorer Shell dependencies.

- Make sure the user you are logged in have Admin privileges.

- Check if Desktop.htt file gets generated under <%UserProfile%\Application Data\Microsoft\Internet Explorer> folder.

- Make sure "Active Desktop Mover" object is registered. It will be mentioned under [HKEY_CLASSES_ROOT\CLSID\{72267F6A-A6F9-11D0-BC94-00C04FB67863}] key. Basically this object is what you see as the toolbar when you move mouse cursor over the top area of the page.

- Make sure the Low security settings for My Computer (local) Internet explorer zone are set.

To explain you why I ask you to check the above, I will have to explain you how the ActiveDektop feature works with a Web component setup. When you set it up in the Desktop Items dialog, Explorer Shell automatically generates an html based file - Desktop.htt - under a user profile folder (the one mentioned above). That HTT file is the Web page you see on your Desktop afterwards. It may contain a few components (Web pages) - they are all FRAMEs within the HTT html file (tag IFRAME used). The HTT page also has an object embedded on the page (OBJECT tag used) - Active Desktop Mover - that is basically the toolbar you see when you move the mouse cursor over the top side of the page. All the Web components and the toolbar appearances are controled by a set of values and subkeys under [HKCU\Software\Microsoft\Internet Explorer\Desktop\Components] key.

Please note that you can open that Desktop.htt file within IE as a regular dhtml page - you will notice it looks very like your Desktop. Obviously, there is no default association for .htt file on XP(e) so you will have to either manually associate it with IE or simply launch the following command line:
iexplore "%UserProfile%\Application Data\Microsoft\Internet Explorer\Desktop.htt"
(replace the %UserProfile% with the actual value of the env.var before the launch)

When launched, you will have to allow IE to render the page with the ActiveX control embedded (the Active Desktop Mover control) via a little popup appearing as the IE info bar.

All the above applies to IE 5.5 and any later version.

What launch in IE gives you? A perfect tool to test whether the toolbar appears or not when you move the mouse cursor over the top of the page. You can fire Regmon/Filemon (better Process Monitor) while running IE instance and monitor what's going on there when you navigate the browser to the HTT page. It will show you all the object Dlls loaded, registry access, etc. Or, better, run the above command line and the mouse hover test through DependencyWalker Profiler (open \program files\Internet Explorer\iexplore.exe, hit F7, type in the full path to HTT file and hit OK). It will show you in red if any Dlls is missing while you are testing the page.


Last update on the issue. When you target the feature for your XPe image and don't want to use a full blown image like XPProEmulation, please make sure you include the template for Desktop.htt. The template is going to be used by the shell to generate the actual Desktop.htt with the list of components you place on your Desktop. If you don't include the template in your image, Web Desktop feature implementation code will use a dummy HTT file that won't have a reference to the toolbar ActiveX component and therefore won't show it on mouse hover event.
Easieast way to get the HTT file in your image is to add "Images and Media" component. However, the component is quite big so you may end up just adding the HTT file only via your own component or TD Extra Files section. That file is is the XPe Repository anyway.


Good luck with debugging Web components on your ActriveDesktop!

6 comments:

Anonymous said...

29047126483369175 I play dofus Replica Watches for one year, I Replica Rolex Watches want to get some Replica Watch kamas to buy Replica Chanel Watches item for my character. So, I search "Replica Swiss Watches" on google and found many website. As Exact Replica Graham Watch the tips from the forum, I just review the Swiss Replica Watches websites and choose some Replica Montblanc Watches quality sites to Replica Cartier Watches compare the price, and go to their Replica Breguet Watches online support to make Replica Breitling Watches the test. And Last Chaos Gold I decide to use Replica BRM Watch at the end. And Tag Heuer Replica Watch that is the Replica IWC Watch beginning..

Hakimtea said...

Thanks ever so much, very useful article. If you do not mind, please visit my article related to travel to Pandeglang district in Banten, Indonesia at Kenali dan Kunjungi Objek Wisata di Pandeglang

Best regards

Adi said...

Find Internet Marketing resource hare Online Marketing Strategy Internet Marketing Tools Online Marketing Campaign Online Marketing Business Online Marketing System Online Business Online Home Business Online Business Tips Internet Marketing Online Online Marketing Affiliate Marketing Online Marketing Success Selling Online Free Online Marketing Online Marketing Tools Online Marketing Blog

bitheads said...

I don’t know If I said it already, but this so good stuff keep up the good work. I read a lot of blogs on a daily basis and for the most part Belajar blogging just wanted to make a quick comment to say I’m glad I found your blog. Thanks.

Best regards
Seo Motivation Oes tsetnoc faq

Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.
Oes Tsetnoc | Semangat Mengembalikan Jati Diri Bangsa

CharlieOnthePA.Turnpike@gmail.com said...

Unlike the ads placed in the comments above, I do appreciate your efforts to explain these features.