As I get the time I've been coding a small ide for my co-workers and I to use at work. I included a function which other people may find useful in their ide's. Basically I just setup a hotkey and when the user selects a block of text in the richedit control and hit that hotkey it opens up that topic in a .hlp file. So this would be put in the hotkey section of the message loop (I subclassed the richedit control):

invoke SendMessage,hREdit,EM_GETSELTEXT,0,addr topicBuffer
invoke WinHelp,NULL,addr szHelp,HELP_KEY,addr topicBuffer
;szHelp is the name/path to the .hlp file
;topicBuffer is just a buffer

Of course, with masm you've got the masm32 .hlp, the win32api .hlp, etc so it would need some clever handling to determine which .hlp file to open the topic in, but for my purposes it works fine. The successful use of this feature rests squarely on the user's shoulders though, since I didn't want to waste my time on idiot-proofing it.

Anyways, I thought someone might want to use this technique for their ide.

cheers,
will

edit: Just to clarify how this would be used... If you're typing something like "invoke GetWindowText..." and select "GetWindowText", hit the hotkey, and the "GetWindowText" topic opens up in the win32api .hlp. I'm not sure how clear that was. :)
Posted on 2002-12-02 17:54:01 by Will
Both Qweerdy and myself have written plugins for Radasm which do just that.:tongue:
Posted on 2002-12-03 10:02:28 by MArtial_Code
Really? I guess that shows just how far out of the loop I am.


Out of curiosity, how do you determine which help file to open for the particular keyword?
Posted on 2002-12-03 10:24:09 by Will
You'll notice my plugin (MSDNHelp) comes with a big Access database called help.mdb. This contains a table "Keywords". Each keyword record has a help file topic associated with it (blank if the help topic is the same as the keyword) as well as a help file ID. In the table "Files" you can then set the path for each helpfile.

The DB was generated by processing the decompiled help files with a very quick and dirty VB program, in case you were wondering.
Posted on 2002-12-03 10:39:12 by Qweerdy
Well that makes sense. I'll have to search for that plugin so I can check it out.
Posted on 2002-12-03 12:48:15 by Will
Qweerdy,
Instead of making a db for each help file why dont you just create a db for Floating Point, instruction set and non-mnemonic keywords and Masm32Lib only.Leave out the Win32 hlp file.
Each time user preses F1 search in the db for the keyword, if it doesnt exist then open the Win32Hlp anyway. This way you dont need to keep a list of all the apis in the win32 hlp file and also it will keep the size of the db much smaller.
Posted on 2002-12-03 23:11:07 by clippy
Gladiator, sorry for the delay :) I only remembered this post because you referred to it in your post in the feedback forum.

Your idea is a good one, except I already have the DB and I think it would be a waste to not use it to its full potential. The current design makes it more modular, and it gives a user a nice error msg when it can't find a topic instead of opening a useless help window. Besides, the current DB is only 786 kilobytes, and I don't really think that is a problem.
Posted on 2002-12-18 10:02:20 by Qweerdy
no problem buddy:alright:
How's the code going? What are you workign on nowdays? Any progress with the pngskin example?:)
Posted on 2002-12-18 10:22:17 by clippy