IE & DELPHI
Resource Tool ver 1.0
When to use:
Using IE & Delphi Resource Tool you can store webpages (including images, cascading stylesheets etc.) inside your application exe-file or in a separate DLL-file.
You can also choose to add permanent or pluggable protocol handler, so your webpages can be called from Internet Explorer or your webbrowser using a protocolname similar to the built-in about-protocol:
"iedelphi:mywebpage"
where "iedelphi" is the name of your protocol and "mywebpage" the name of the stored webpage.
The tool also include a WYSIWYG helper for editing and adding features to html-dialogs.
How to use:
Place IEResTool.exe in its own directory.
First time you run IERestool you will need to tell the full path to your Delphi bin-directory, where BRCC32.EXE and DCC32.EXE are located.
Next add full path to the directory where the files you want to add are located.
It is important that all files to be included are placed in this directory. IEResTool don't include subdirectories. All html-files must use simple links, e.g.:
<A HREF="page.htm"><IMG SRC="picture.jpg"></A>
If you need IeResTool to be more flexible on this point (read files from subdirectories and resolve relative links) you can make the nessecary changes to the included source code.
IEResTool first reads all files in the directory with file-ext. ".htm" or ".html". Next it includes all files called from these files. This means that you don't have to worry about extra files in the directory. If they are not needed to display the .htm or .html files, they are not included in the resource files.
Next step is adding a protocol name:
You can use any letters or numbers [a..z, A..Z, 0..9] in the protocol name. However you cant use a number as the first character:
abc123 = works fine
123abc = don't work
IERestool check and let you know, if you enter an illegal protocol name.
Protocol names are case in-sensitive.
IERestool creates a new unique indetifier for each new protocol name,
but it saves protocol names you have used before and the GUID associated
with it. You can use the dropdown box to re-select protocol names. This is
important if you for instance create an updated version of a DLL with a
permanent pluggable protocol. (see more about this later).
Select if you want to save source file for the created DLL-files and the temporary HTML-files. The default setting is shown above, and you should only save modified HTML-files for debugging if unexpected errors occurs.
Now you are ready to go. Click "Create" button. If you store large websites inside resource files it may take several minutes for IERestool to finish the work, but in most cases it only takes few seconds.
The stored webpages and/or HTMLdialog-files are shown in the listbox, and you can choose to see them in the default browser or as HTML-dialog.
Before closing IEResTool you should create featurestring for the HTML dialogs in your resource file. Select the dialog files in the listbox and click "Test as HTMLDialog".
a new window will open:
Use the options to select the window ornaments for the dialog box. More
info about each option is available in a hint-box when you select an item.
Whenever you want you can see the result by clicking "Test". The
Dialog is now showing with the options you have selected, and you can now
resize the dialog and drag it to the top/left location where you want it
to show up. When you resize or move the dialog it will be reflected in
top, left, height and width coordinates, so you dont have to enter these
manually.
When the HTML dialog looks the way you want it, you click "FeatureString to Clipboard" and you can now paste it into your Delphi-code. The string may look like this:
dialogHeight: 180px; dialogWidth: 405px; dialogTop: px; dialogLeft: px;' center: 1; dialoghide: 0; edge: raised; help: 0; resizable: 0; scroll: 0;' status: 0; unadorned: 0;
To show the Dialog in your program you can use something like:
procedure ShowAboutDialog; var Url: string; Moniker: IMoniker; v1, v2: Variant; F: string; begin f := 'dialogHeight: 180px; dialogWidth: 405px; dialogTop: px; dialogLeft: px;' + ' center: 1; dialoghide: 0; edge: raised; help: 0; resizable: 0; scroll: 0;' + ' status: 0; unadorned: 0;'; Url := 'res://' + Application.Exename + '/about'; CreateUrlMoniker(nil, StringToOleStr(Url), Moniker); ShowHTMLDialog(Handle, Moniker, v1, StringToOleStr(F), v2); end; |
In this example the resources for the HTMLDialog is stored inside the exe-file and no protocol is attached.
If protocol name was "iedelphi" and the protocol was activated the url would be: "iedelphi:about".