🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3545

Using CHM files in BCB6

#3545
From: Analian
Date: Fri, 26 May 2006 09:11
42 lines
2354 bytes
Since there isn't a native support for .chm files in BCB6, I did some search 
in google groups about doing it and finally I ended with a piece of code 
like this:

bool TForm1::DisplayHelp(void)  {
    AnsiString HelpFile = "a.chm";

    RunProgram(HelpFile, "");
}
//--------------------------------------------------------------------------

bool TForm1::RunProgram(AnsiString Name, AnsiString Parameters)  {
    SHELLEXECUTEINFO execinfo ;

    memset (&execinfo, 0, sizeof (execinfo)) ;
    execinfo.cbSize = sizeof (execinfo) ;
    execinfo.lpVerb = "open" ;
    execinfo.lpFile = Name.c_str () ;
    execinfo.lpParameters = Parameters.c_str () ;
    execinfo.fMask = SEE_MASK_NOCLOSEPROCESS ;
    execinfo.nShow = SW_SHOWDEFAULT ;

    ShellExecuteEx(&execinfo);
}
//--------------------------------------------------------------------------

That's okay, it displays the .chm file but I'd like to do two things more, 
which I didn't figure how to do:

1) Since the .chm file is organized in pages (chapters maybe, not sure what 
the word is), I'd like to be able to programatically open it at a specific 
page (say, "Welcome").
With .hlp files I used HelpJump to do that but I can't do it with .chm 
files.
So how do I do it?

2) How to make sure only one instance of this .chm file is actually run?
Writing to the registry comes in mind, but is there a more clever way to do 
it?

Thank you,
Analian 
Technical Details
Message-ID: <4476c656$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!newsfeed.inode.at!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,27bcb2a52828a1c4,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Analian" <analian@mail.bg>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Using CHM files in BCB6
Date: Fri, 26 May 2006 12:11:42 +0300
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 85.187.23.202
Message-ID: <4476c656$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1148634710 85.187.23.202 (26 May 2006 02:11:50 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!newsfeed.inode.at!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail