Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8811371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:20:51+00:00 2026-06-14T03:20:51+00:00

I am able to open a CHM file by passing a ShortInteger and casting

  • 0

I am able to open a CHM file by passing a ShortInteger and casting it as a Word for the dwData parameter. I.E.

Unit Help;   //this is where the Id's are set with their description
 Interface
 Const

Address_File = 35;  //delphi identifies Address_File as a shortint
etc..

Call get help pass my ID

GetHelp(Address_File); //call get help pass my ID to open to the Address_File topic

GetHelp procedure

procedure GetHelp(HelpID : Word);
begin
  Application.HelpFile := ProgramPath + 'help.chm';
  HtmlHelpW(0, PWideChar(Application.HelpFile),HH_HELP_CONTEXT , HelpID);
end;

HtmlHelpW function

function HtmlHelpW(hwndCaller : HWND; pszFile: PWideChar; uCommand : Integer;
         dwData : DWORD) : HWND; stdcall; external 'hhctrl.ocx' name 'HtmlHelpW';

As I pass different ShortIntegers I am able to initialize the help file at different sections.
However I can’t figure out how the values are mapped. There are some sections in the chm file that I want to be able to map to but the short Integer or context ID associated with them is not documented in the program or is not mapped.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:20:53+00:00Added an answer on June 14, 2026 at 3:20 am

    Free Pascal comes with a chmls.exe util that has a command that tries to recover the alias (context) data:

    chmls, a CHM utility. (c) 2010 Free Pascal core.
    
    Usage: chmls [switches] [command] [command specific parameters]
    
    Switches :
     -h, --help     : this screen
     -p, --no-page  : do not page list output
     -n,--name-only : only show "name" column in list output
    
    Where command is one of the following or if omitted, equal to LIST.
     list       <filename> [section number]
                Shows contents of the archive's directory
     extract    <chm filename> <filename to extract> [saveasname]
                Extracts file "filename to get" from archive "filename",
                and, if specified, saves it to [saveasname]
     extractall <chm filename> [directory]
                Extracts all files from archive "filename" to directory
                "directory"
     unblockchm <filespec1> [filespec2] ..
                Mass unblocks (XPsp2+) the relevant CHMs. Multiple files
                and wildcards allowed
     extractalias <chmfilename> [basefilename] [symbolprefix]
                Extracts context info from file "chmfilename"
                to a "basefilename".h and "basefilename".ali,
                using symbols "symbolprefix"contextnr
     extracttoc <chmfilename> [filename]
                Extracts the toc (mainly to check binary TOC)
     extractindex <chmfilename> [filename]
                Extracts the index (mainly to check binary index)
    

    This might be a start, since at least you’ll know which pages are exported using an ID, and maybe the URL names will give some information.

    The util is in recent releases (make sure you get 2.6.0) and also available in Free Pascal source, which should be convertable to Delphi with relatively minor effort.

    Basically the chmls tool was created out of various test codebases. The testprograms decompiled and printed contents of different CHM sections and were used while creating the helpfile compiler, chmcmd, which is also part of FPC.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to be able to open a given file, and see that This
I am not able to open an excel file to write data using following
I would like the designer to be able to open the same solution file
Here is the case. User should be able to open MS Word document which
I’d like to be able to open a text/html file and write its contents
How would I be able to open a file (lets say an .html file)
I have code like below. If I open the file $File::Find::name (in this case
I want to be able to open a pdf file from my application without
I want to be able to open/view a image (.jpg) without locking the file.
I want to be able to open a .txt file up into a richtextbox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.