Pelles C forum

General => Chit-Chat => Topic started by: JohnF on June 26, 2014, 01:12:23 PM

Title: CHM's
Post by: JohnF on June 26, 2014, 01:12:23 PM
Does anyone know how to start a .CHM file and search for a keyword from commandline.

This starts the CHM
hh.exe thefile.chm

But what switches are needed?

Thanks for any help, I've surfed but no luck.

John
Title: Re: CHM's
Post by: frankie on June 26, 2014, 02:01:27 PM
Maybe here (http://msdn.microsoft.com/en-us/library/windows/desktop/ms524369(v=vs.85).aspx)?
Title: Re: CHM's
Post by: JohnF on June 26, 2014, 02:40:36 PM
Yes I've seen that but it's as clear as mud, can't work out what's required to run from the commandline.

I'm guessing but,

hh.exe [something here] help.chm

John

Title: Re: CHM's
Post by: JohnF on June 26, 2014, 04:04:42 PM
Didn't get anywhere with commandline so wrote a small app.

Code: [Select]
#include <windows.h>
#include <htmlhelp.h>

int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hinstPrev,
CHAR *lpCmdLine, int nCmdShow)
{
char s[400];
strcpy(s, lpCmdLine);
HH_AKLINK link;
link.cbStruct = sizeof(HH_AKLINK);
link.fReserved = FALSE;
link.pszKeywords = s;
link.pszUrl = NULL;
link.pszMsgText = "HtmlHelp Error";
link.pszMsgTitle = NULL;
link.pszWindow = NULL;
link.fIndexOnFail = FALSE;
HWND h = HtmlHelp(GetDesktopWindow(),
"D:\\help.chm",
HH_KEYWORD_LOOKUP, (DWORD) & link);

while(IsWindow(h)){
Sleep(100);
}
return (0);
}

John
Title: Re: CHM's
Post by: czerny on June 26, 2014, 07:32:16 PM
http://www.help-info.de/de/Help_Info_HTMLHelp/hh_command.htm (http://www.help-info.de/de/Help_Info_HTMLHelp/hh_command.htm)
Title: Re: CHM's
Post by: JohnF on June 26, 2014, 08:19:44 PM
http://www.help-info.de/de/Help_Info_HTMLHelp/hh_command.htm (http://www.help-info.de/de/Help_Info_HTMLHelp/hh_command.htm)

Czerny, thanks, I've seen the English version of that page, it doesn't help as the commandline is asking for a .htm

See my previous post, I made a small app to do the job.
 
John

Title: Re: CHM's
Post by: czerny on June 28, 2014, 11:49:53 AM
Code: [Select]
"D:\\help.chm",
John, what help file have you used?
Title: Re: CHM's
Post by: JohnF on June 28, 2014, 12:41:29 PM
It is vccore.chm.

I've just installed VC6 on Win7 so wanted that help file usable from within the IDE.

John
Title: Re: CHM's
Post by: czerny on June 28, 2014, 05:43:08 PM
I do not own VC6, so I have used an other help file:
Title: Re: CHM's
Post by: JohnF on June 28, 2014, 07:30:26 PM
Thanks.

Yes that's quite good, only both cpp.chm and vccore.chm are a little dated - they don't list the more modern functions.

The reason for using it in VC6, is that VC6 only supports the older functions! The best one to use is the PellesC chm file.

vccore.zip is too big to upload here.

EDIT: And thanks for the command line strings.

John