blez's : blog

code / design / music and more

Leave a comment

Embed HTML resources in a DLL and use it with the res:// protocol

Maybe you know that the Microsoft WebBrowser control can load HTML, images and javascipt from an unmanaged resource.
If you embed those files in a DLL, you can have a nice container for a HTML skin (for example).
So I did this small tool that automates the process. It uses HTMLRes (third party app) and FASM, to compile DLL file with the .res file outputed from HTMLRes.


– Put the files you want in the DLL to have into Content

– Run BUILD.bat

– The skin file is “skin.dll” in the same directory.

You can use it from the WebBrowser control like this: res://somefile.dll/index.html

NOTE: If you use .NET, you’ll need an extension to the standard WebBrowser control to load DLL files. Get it from here