You're adding twice into a compiled chm file with a third party application 2 equal ALink .
Then you give Delphi XE2 the blame when the chm file is not working as expected?
1.) You can not use AKeyword with
HtmlHelpW(Handle, Application.HelpFile, HH_ALINK_LOOKUP, DWORD_PTR(@aLink))
you can try it with a KLink Keyword:
HtmlHelpW(Handle, Application.HelpFile+'>main', HH_DISPLAY_TOPIC, DWORD_PTR(nil));
HtmlHelpW(Handle, Application.HelpFile, HH_KEYWORD_LOOKUP, DWORD_PTR(@link));
ALink
is a jump from his appearance here, as well as a KLink
display or jump in Related Topics.
The list of topics found, however, is not based on keywords from the index, but on ALink names
that were involved in the .htm file.
This can be used only with ALinks. The following is a ALink.
part of a xy.htm
<Object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="ALink Name" value="UsingtheMenus">
</OBJECT>
2.) In your code I can not see following:
HtmlHelpW(Handle, Application.HelpFile, HH_DISPLAY_TOPIC, DWORD_PTR(nil));
- You must first call the HH_DISPLAY_TOPIC command before calling
HH_ALINK_LOOKUP
, to ensure that the help window is created.
HH_ALINK_LOOKUP command
- Help authors insert ALink names into target topic files using the HTML Help Compiler Information feature.
- ALink : name="ALink Name" value="lookupAlink"
- KLink : name="Keyword" value="lookupKeyword"
lookups are case sensitive. Multiple lookups are delimited by a semicolon.
Besides automatically generated keywords, when compiling a .htm source file .

Can you use an explicit KLink.
This is an explicit "KLink" the place may be anywhere in a .htm file, used for Keywords
<Object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="Keyword" value="lookupKeyword">
</OBJECT>
The beneficial if you have a Error Message is created, the error is displayed and the Application continues normally. Source from answer How to add support of HTML help files (.chm)....
procedure TForm1.HHALINKLOOKUPClick(Sender: TObject);
var
link : HH_AKLINK;
szUrl,szKey,szMsgText,szMsgTitle,szWindow : AnsiString;
begin
szKey := Edit1.Text; // 'UsingtheMenus';
szUrl :='Overview.htm';
szMsgText :='Error: Can''t find "'+Edit1.Text+'"!';
szMsgTitle :='Error: HH_ALINK_LOOKUP';
szWindow :='main';
with link do begin
cbStruct := sizeof(HH_AKLINK) ;
fReserved := False;
pszKeywords := PChar(szKey);
pszUrl := nil;
pszMsgText := PChar(szMsgText);
pszMsgTitle := PChar(szMsgTitle);
pszWindow := PChar(szWindow);
fIndexOnFail:= False;
end;
HtmlHelpW(Handle, Application.HelpFile+'>main', HH_DISPLAY_TOPIC, DWORD_PTR(nil));
HtmlHelpW(Handle, Application.HelpFile, HH_ALINK_LOOKUP, DWORD_PTR(@link));
end;
And that do you get when you ALink "UsingtheMenus" calls without last letter "s".

Test your : with 3rd party application changed chm file
You can test any .chm file with HTML Help Workshop



