AutoHotkey Community

It is currently May 27th, 2012, 7:23 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: June 6th, 2006, 6:35 am 
Offline

Joined: December 16th, 2005, 3:29 am
Posts: 148
Location: Australia
Anyone know how to keyword seach in a CHM file, particularly Autohotkey.chm from CMD.EXE?

I give up, not one so called HH.exe command line gives me any hints.

Quote:
HTML Help

hh.exe [-decompile folder] [-mapid id] [-800] [-title text] helpfile
Decompile Decompiles all the original HTML files, graphics, stylesheets, contents, and index that make up a help file. Folder is the folder to decompile to. It only seems to work if the original files were only one folder deep.
Mapid The topic to open
800 Open help to a 800 x 600 window but without covering the taskbar (so its smaller than 800 x 600). It won't override a size set in the helpfile.
Title Sets the window title to use. It won't override a title set in the helpfile.
Helpfile Helpfile to open


this is supposed the cmdline functions.

I tried all sorts of combo, say to find in CHM filecopy:
HH.exe -mapid:filecopy ms-its:c:\program files\autohotkey\autohotkey.chm <<dont work!!
HH.exe -mapid filecopy ms-its:c:\program files\autohotkey\autohotkey.chm <<dont work!!
HH.exe -title filecopy ms-its:c:\program files\autohotkey\autohotkey.chm <<dont work!!
HH.exe -title filecopy ms-its:c:\program files\autohotkey\autohotkey.chm <<dont work!!

and many others.. too much to list.. :evil:

I'm starting to wonder if there is any??!?

the good old HLP file is much much much easier:
Quote:
winhlp32 -k _hread win32.hlp << see!!! EASY and LOGICAL
= I'm looking for _head keyword in win32.hlp

-k = keyword, LOGICAL


now this CHM.. what is it trying to do?? make new probs??!?! confuse the crap out of ppl??!? want us to purchase another license/manual?

arrgghh..

I manage to download an app called "keyHH.exe" and that solved it..
Quote:
keyHH.exe -#klink filecopy c:\program files\autohotkey\autohotkey.chm


but I just want confirmation:

can HH.EXE do KEYWORD/phrase search?!!? similar to that of the old winhlp32?

btw.. anyone got any suggestions or better methods than hlp/chm.. I am feed up having to adjust to different formats.

_________________
Image
546F206C69766520
6973204368726973742C0D746F2064696520
6973206761696E2E0D285068696C20313A323129


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2006, 9:33 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Did you saw "how to call-up the AHK help directly i.e. not from tray"?
hh mk:@MSITStore:C:\Program Files\AutoHotkey\autohotkey.chm::/docs/commands/MsgBox.htm

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2006, 10:06 am 
Offline

Joined: December 16th, 2005, 3:29 am
Posts: 148
Location: Australia
Thats after you decompile the CHM before you can gather that command or a CHM structure peek.

i.e. autohotkey.chm::/docs/commands/ << this part cannot be gathered wihtout first knowing the structure and yes, I have read it.

What I am refering to is a generic command for ANY chm files.

Allow me to give you an example. In UEStudio, I just add the ahk.chm in the help menu and it will context search the word I highlighted. Now UEstudio will not figure out docs/commands/ structure. So it uses an internal dll (which I believe is the case) to call the context search.

The app I've found is keyHH.exe which achieved this via DOS. But it is simply unbelievable that since CHM is newer than the old HLP but yet I cannot use keyword search?? thats simply stupid since its suppose to be a Help file to begin with.

I compiled/use all my help with the old HLP but AHK and some new docs/help uses CHM.

Another difference is that if its a keyword it will get me to the Index tab highlighting the closest find. But with the method you stated, it will give me an error page if its not there since it doesnt exist. e.g. msgboxa
Code:
/docs/commands/msgboxa.htm << refering to the chm compile structure.

will produce page error.

The main reason I need a 1 line call is because the the text editor I use allow me to customize the menu so naturally I want to add the keyword search feature in for AHK.

_________________
Image
546F206C69766520
6973204368726973742C0D746F2064696520
6973206761696E2E0D285068696C20313A323129


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2006, 2:13 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
How I guessed the structure? I right-clicked on a page of the CHM, chose Properties, then looked at the URL...

Now, you can call such file with a DllCall.
Here is how SciTE (and probably other editors) is calling a CHM entry:
Code:
// HH_AKLINK not in mingw headers
struct XHH_AKLINK {
   long cbStruct;
   BOOL fReserved;
   const char *pszKeywords;
   char *pszUrl;
   char *pszMsgText;
   char *pszMsgTitle;
   char *pszWindow;
   BOOL fIndexOnFail;
};

// Help command lines contain topic!path
void SciTEWin::ExecuteHelp(const char *cmd) {
   if (!hHH)
      hHH = ::LoadLibrary("HHCTRL.OCX");

   if (hHH) {
      char *topic = StringDup(cmd);
      char *path = strchr (topic, '!');
      if (topic && path) {
         *path = '\0';
         path++;   // After the !
         typedef HWND (WINAPI *HelpFn) (HWND, const char *, UINT, DWORD);
         HelpFn fnHHA = (HelpFn)::GetProcAddress(hHH, "HtmlHelpA");
         if (fnHHA) {
            XHH_AKLINK ak;
            ak.cbStruct = sizeof(ak);
            ak.fReserved = FALSE;
            ak.pszKeywords = topic;
            ak.pszUrl = NULL;
            ak.pszMsgText = NULL;
            ak.pszMsgTitle = NULL;
            ak.pszWindow = NULL;
            ak.fIndexOnFail = TRUE;
            fnHHA(NULL,
                  path,
                  0x000d,             // HH_KEYWORD_LOOKUP
                  reinterpret_cast<DWORD>(&ak)
                 );
         }
      }
      delete []topic;
   }
}

If you are good at DllCall and structure writing, you should work this out. Otherwise, I can give a try, it shouldn't be that long.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2006, 2:01 am 
Offline

Joined: December 16th, 2005, 3:29 am
Posts: 148
Location: Australia
KRIKY!!!! :shock:

okay, I'll stick to KeyHH.exe.

Now I know for sure CHM is NOT good... :lol: despite the addition features (which I don't need anyway for a help file).

Quote:
If you are good at DllCall and structure writing, you should work this out. Otherwise, I can give a try, it shouldn't be that long.

Thanks for offering the help PhiLho, but even if we write it. We will simply produce another keyHH.exe, so more or less re-inventing the wheel. Unless someone needs it for a text editor written in AHK/other lang?
But surely I won't need it.

thanks for the reply PhiLho, greatly appreciate it!!

_________________
Image
546F206C69766520
6973204368726973742C0D746F2064696520
6973206761696E2E0D285068696C20313A323129


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2006, 8:50 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Well, it isn't that hard, and it may be useful if somebody want to release a CHM help for his AutoHotkey application.
The advantage would be to be a pure AHK solution, no need for an external program.
BTW, please, provide a link to KeyHH. I can Google for it, of course, but it is nicer to avoid some steps. :-)

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2006, 8:32 am 
Offline

Joined: December 16th, 2005, 3:29 am
Posts: 148
Location: Australia
A MUST GET tool for those who need to access CHM files on commandline or any other shell. It is much much more versatile than the windows HH.exe (piece of crap!!).

here is the function list:
Quote:
-To create another HTML Help window that won't close when the original window is closed
-To link from a WinHelp topic to a CHM file
-To find topics with keywords in common (KLink)
-associative linking (ALink)
-context-sensitive topic
--#register and -#unregister

KeyTools is free. You may download it and install it on as many machines as you want for no charge. The download size is around 300K


The Main page:
http://www.keyworks.net/

Download just KeyHH.exe (come-on what are you waiting for?)
http://www.keyworks.net/KeyHHSetup.exe

The help for KeyHH.exe
http://www.keyworks.net/keyhelp.htm

HHSwitch is a testing utility that allows you to switch between the various versions of HTML Help.
http://www.keyworks.net/hhswitch.htm

KeyTools is a set of utilities for managing the WinHelp and HTML Help systems on your computer, and for optimizing those help systems for better performance.
http://www.keyworks.net/keytools.htm

and DE description:
http://www.help-info.de/de/Help_Info_HTMLHelp/hh_command.htm

_________________
Image
546F206C69766520
6973204368726973742C0D746F2064696520
6973206761696E2E0D285068696C20313A323129


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group