I am using the delphi package HelpManRCI to create my own property editor on the helpcontext.
I am using this code to get my self a list of items.
Somehow the call to ReadItem does not function properly.
The function ReadItemCallback is never called.
Does anyone know how to use this?
Code: Select all
THelpItem = class(TObject)
Id: string;
Handle: HWND;
TopicRecord: PHMTOPICRECORD;
HelpContext: Integer;
end;
implementation
function ReadItemCallback(pBuffer: Pointer; iData: Integer; AppData: integer): BOOL; cdecl;
var
item: THelpItem;
begin
// this function is never called
item := THelpItem(AppData);
item.TopicRecord := PHMTOPICRECORD(pBuffer);
Result := True;
end;
function GetListCallback(pBuffer: Pointer; iData: Integer; AppData: integer): BOOL; cdecl;
var
helpItem: THelpItem;
begin
helpItem := THelpItem.Create;
helpItem.Id := pchar(pBuffer);
helpItem.HelpContext := GetContextNumber(hmInstance, pBuffer);
helpItem.Handle := GetItemID(hmInstance, HMINVISIBLELIST, pBuffer, 0);
if helpItem.Handle = 0 then
helpItem.Handle := GetItemID(hmInstance, HMTOCLIST, pBuffer, 0);
// if (hItem > 0) then
// SelectItem(hmInstance, hItem); // this works, so the Handle is correct
ReadItem(hmInstance, helpItem.Handle, HMTOPIC_ALLMEMBERS, ReadItemCallback, Integer(helpItem));
TopicList.Add(helpItem);
Result := True;
end;