Click here to Skip to main content
13,905,154 members
Click here to Skip to main content
Add your own
alternative version


76 bookmarked
Posted 8 Aug 2003

HOWTO: Use the undocumented HTMLLITE.DLL component

, 8 Aug 2003
Rate this:
Please Sign up or sign in to vote.
There is an undocumented DLL library included with VS.NET called HTMLLITE...

Sample Image - htmllite.gif


There is an undocumented DLL component used in the Installer of VS.NET that allows you to render HTML for your application, and all from a simple window class.

The control would allow you to render, say, a richly formatted report in your application and display it to the user.

The library is located at \Program Files\Microsoft Visual Studio .NET 2003\Setup\Visual Studio .NET Enterprise Architect 2003 - English with the filename: htmllite.dll (136 Kb).

You must copy the DLL from here and place it with the other source and executable files extracted from the ZIP archive. The DLL has not been included in the ZIP for redistribution reasons.

How to use HTMLLITE

The library is very simple to use. You need to first call a sub aliased:


... and this will make ready the window class for use in your application (similar to calling InitCommonControls).

The control can then be created with CreateWindowEx like any other window:

   "TODO: HTML goes here...", WS_CHILD | WS_VISIBLE, 
   10, 10, 500, 500, hWnd, 0, 0, 0);

The control is then ready and visible on your parent window.

Under the hood

A few weeks ago when I first started tinkering with HTMLLITE, I spent a few hours on that ancient utility called Spy++ to see what messages HTMLLITE was using...

I found that HTMLLITE works very similar to the standard Windows Common Controls, such as ListViews. It makes use of WM_NOTIFY, to send notifications to your application about mouse clicks, moves, and others.

The lParam of the WM_NOTIFY contains a pointer to a NMHDR structure, and like any other control, the members are no different... hwndFrom, idFrom and code.

'Code' was the important one, so I set about learning what each code meant and came up with the following:

//HTMLLITE Notify Codes

//A link has been clicked either via
//... the Mouse or Spacebar key
//A link has received focus due to 
//... the Tab Cycle, or Keyboard Arrow Keys
//A link has been right-clicked, and already had focus
//Mouse is over a link
//Mouse is hovering a link (~1 second = hover)
//Mouse has left a link's rectangle


The control also uses its window text/caption as the source for the HTML. So if you want to change the HTML content after it has been created, simply send a WM_SETTEXT message containing the new HTML.

Next step was to find a way to determine which hyperlink had been clicked in any given HTMLLITE control instance. As pot luck had it, a couple of days ago I stumbled upon the MSDN pages about the SYSLINK control (new with Common Controls v6). The SYSLINK control is similar to HTMLLITE except it can only render simple <a href> style markup. I tried out the notification structure of the SYSLINK control to see if HTMLLITE used anything similar.. and.. hut-damn, it did:

typedef struct tagNMLINK { //nm structure for SYSLINK
    NMHDR hdr;
    LITEM item;

After about half an hour I had reversed the entire HTMLLITE NM structure...

The most important member is linkid. This member contains the value of the parameter linkid used in a <a href="..."> style markup. So if you have more than one link in a HTMLLITE control, simply add linkid parameters to your <a>'s and they will be filled into the following structure's similarly named member.

typedef struct NMHTMLLITE {
  //The Window Handle (hWnd) of the HTMLLITE control
  //... sending you this message.
  DWORD hwndFrom;      
  //If your HTMLLITE control is on a dialog, this member
  //... contains its Dialog ID.
  DWORD idFrom;
  //As defined below. As an example, this member will
  //... equal HTMLLITE_CODE_LEFTCLICK when a Link has
  //... been Left-clicked.                      
  DWORD code;  
  //When you create a Link with <a href="..." linkid=xxx>
  //... the linkid parameter is filled in this member.
  //.. allowing you to know which link has been clicked
  //... in your HTMLLITE control and then perform a specific action.
  DWORD linkid; 
  //This is a RECT structure which contains the coord's and
  //... dimensions of the Link concerned.      
  RECT  linkrc; 

Easy peasy.

Extent of HTML implementation?

Well to be honest, I am unsure. I know it seems to use CSS-alike HTML, but it is not really W3C quality :)

Here are a few pieces of markup that MS .NET apps use, so you'll know how much I know:

<p highlight=#003399 padding-left=20 padding-top=14 padding-bottom=14>
<font face="arial" size=12pt color="white"><b>Microsoft®</b></font>
<br><font face="arial" size=22pt color="white">Visual Studio® .NET Setup
<p align="right"><a color=#3F4F7F HOVER-COLOR=#C3120C linkid=211>
<b>Text goes here</b></a></p>

Earlier today I checked if Tables would work - they didn't.

Please post comments in the section below, so we can fill the holes in this particular area.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Nathan Evans
Software Developer (Senior)
United Kingdom United Kingdom
I am the lead developer of numerous .NET-based networking and communication server systems for Windows, for a company based in Cambridge. Including SMS/SMPP, VOIP and VoiceXML technologies.

You may also be interested in...


Comments and Discussions

GeneralAdd text Pin
gene415-Aug-09 5:11
membergene415-Aug-09 5:11 
GeneralManaged wrapper Pin
caddzooks24-Aug-07 2:23
membercaddzooks24-Aug-07 2:23 
Generalthe format of IMG tag using bitmap from resource Pin
zhaowd20013-Aug-06 20:51
memberzhaowd20013-Aug-06 20:51 
QuestionLicense Pin
gnjunge16-Sep-05 10:42
membergnjunge16-Sep-05 10:42 
GeneralMS Money has been using HTMLLite Pin
MikeyN9-Aug-05 15:36
memberMikeyN9-Aug-05 15:36 
GeneralHTMLLite Vertical Scrolling Pin
AlainCD18-Feb-05 4:51
memberAlainCD18-Feb-05 4:51 
GeneralRe: HTMLLite Vertical Scrolling Pin
Harry110823-Dec-05 11:14
memberHarry110823-Dec-05 11:14 
GeneralGreat Pin
Armen Hakobyan17-Jan-05 2:45
professionalArmen Hakobyan17-Jan-05 2:45 
GeneralRe: Great Pin
Nathan Evans17-Jan-05 5:07
memberNathan Evans17-Jan-05 5:07 
GeneralWant IE and IpHelper Help [modified] Pin
eiteit23-Nov-04 4:59
membereiteit23-Nov-04 4:59 
QuestionHow to embed this in an editbox instead? Pin
jiac1214-Jan-04 6:36
memberjiac1214-Jan-04 6:36 
Generalhtmllite.pas Pin
avatarcr29-Oct-03 8:13
sussavatarcr29-Oct-03 8:13 
GeneralI changed the function prototype to the following and everything appears to work fine under VS6/7 Pin
turbo2827-Oct-03 0:59
memberturbo2827-Oct-03 0:59 
Generalsuported html Pin
Sourcer10-Oct-03 5:57
memberSourcer10-Oct-03 5:57 
GeneralRe: suported html Pin
Sourcer10-Oct-03 6:10
memberSourcer10-Oct-03 6:10 
GeneralRe: suported html Pin
Nathan Evans10-Oct-03 6:28
memberNathan Evans10-Oct-03 6:28 
GeneralRe: suported html Pin
Anonymous21-Apr-04 9:57
memberAnonymous21-Apr-04 9:57 
GeneralRe: suported html Pin
AlexEvans29-Nov-05 13:09
memberAlexEvans29-Nov-05 13:09 
GeneralRe: suported html Pin
Genghis8610-Apr-07 16:53
memberGenghis8610-Apr-07 16:53 
GeneralRe: suported html Pin
LycaonX25-Feb-11 9:40
memberLycaonX25-Feb-11 9:40 
GeneralGood Work! Pin
lachlan7212-Aug-03 13:33
memberlachlan7212-Aug-03 13:33 
GeneralMarkup Pin
mabZERO12-Aug-03 8:46
membermabZERO12-Aug-03 8:46 
GeneralRe: Markup Pin
mabZERO12-Aug-03 10:00
membermabZERO12-Aug-03 10:00 
GeneralRe: Markup Pin
Nathan Evans12-Aug-03 11:15
memberNathan Evans12-Aug-03 11:15 
GeneralRe: Markup Pin
Nathan Evans12-Aug-03 11:24
memberNathan Evans12-Aug-03 11:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web03 | 2.8.190306.1 | Last Updated 9 Aug 2003
Article Copyright 2003 by Nathan Evans
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid