Creating Windows® help files

To create Windows® help files(*.hlp)u can use a tool that ships with Delphi called microsoft® help workshop.But there is still allot of work to do with this tool for example you need rtf formated files I don't wanna be a spammer here certainly not but the easiest to use helpfile generator i know of is called dothelp to create a new project in dothelp choose file new project you should see this screen
screenshot
Follow the wizard steps at the end you can input your help topics etc in a screen like this.
screenshot
now you can begin creating the help file just click the topic at the left end on the right format your text as you want it end type your text that's it after you're done with typing the help texts linking files etc you can use the compile command.Dothelp uses microsoft® help compiler.In the project wizard you can even choose what kind of help you want to provide htmlhelp or 32 bit windows® help to demonstrate how easy this program works i created a helpfile for our program memorymeter.Also remember the help id's you will need these id's later when you link your help file into your Delphi application.You see a screenshot of the helpfile i created with dothelp for the program memorymeter
screenshot
offcource dothelp isn't free software i created this example with the trial version of dothelp if you want to try dothelp you can find it on the homepage of the product now you created a windows® help file how do you display it when a user chooses help from a menuitem or a button one way to do this is like this
procedureTMainForm.Help1Click(Sender:TObject);
begin
ShellExecute(Handle, 'open', PChar('FileName.HLP'), nil, nil, SW_SHOW);
end; use the helptopic id's in dothelp end assign them to the helpcontext property of the components in your delphi application.Because the above example of excecuting a helpfile can cause an error for example if windows® can't find the help file in that case you should show a messagebox to inform the users of your application about this.For example like this


procedure TMainForm.Help1Click(Sender: TObject);
var sr :string;
var ay : array[0..255] of Char;
var FileExits :Boolean;
begin if FileExists(ExtractFilePath(Application.ExeName)+'\Mem.HLP') then begin
sr := 'WinHelp.exe '+ExtractFilePath(Application.ExeName)+'\Mem.HLP';
StrPCopy(ay,sr);
WinExec(ay,1);
end else
messageDlg('The Help file was not found.', mtError, [mbOK],0);
end;
end;

don't type ; after the first end because you need an else statement end if you type the similicon the compiler wil complain about it in Delphi you may not type similicons in if-else statements.So that's it now when a user of your application trys to run the help file and windows® can't find it a messagebox wil appear to noitfy him about the error.Also there is a great program for creating html help called htmlhelp workshop.this program is freeware created by microsoft® and availible on the msdn site
http://msdn.microsoft.com/library/en-us/htmlhelp/html/htmlhelp.exe


Navigation links

index main page of this website
info info on file extensions produced by the Delphi ide
ide information about the Delphi ide
links links to other Delphi related websites
tips Delphi ide keyboard shortcuts etc
sourcecode Delphi sourcecode
about little info about me
books a list of Delphi books
board Delphi programming discussion board
newsgroups a list of Delphi programming discussion newsgroups
webring wanna join the DelphiVillage webring?
guestbook let me know you where here in my gustbook
components how to build Delphi components?
delphi™topsites i joined many toplists here is mine
setup how to build a setup program?


Delphi™ is a ® trademark from borland software company inc all rights reserved.
Windows™ is a ® trademark from Microsoft corporation
DelphiVillage copyright © 2001 Loos Erik all rights reserved