Hi Qweerdy,

I use MSDN almost exclusively for my API help including messages, it would be too much to put the full set of messages in the KWL file so I was thinking that it would be useful to be able to specify a default file. I have adapted the code for my use by doing the following.

Added a default help that will check the RadASM.INI file for the appropriate file...

defhelp db "default",0


align 4
DefaultHelp proc pkeyword:dword
LOCAL defapihelp[MAX_PATH] :BYTE
LOCAL pRadasmini :DWORD
LOCAL nullstring :DWORD

mov nullstring,0

mov eax,lpData
mov eax,[eax+ADDINDATA.lpIniFile]
mov pRadasmini,eax

invoke GetPrivateProfileString, addr szRadHelp, offset defhelp,\
ADDR nullstring, ADDR defapihelp, MAX_PATH, pRadasmini
or eax,eax
jz @F
invoke OpenHelp,pkeyword,addr defapihelp
mov eax,TRUE
@@:
ret

DefaultHelp endp


Made the following change to DLLProc...

invoke FindKeyword,addr kwbuf

.if eax
invoke OpenHelp,addr kwbuf,eax
ret
.else
invoke DefaultHelp,addr kwbuf
ret
.endif


If no default is specified in RadASM.INI under "default" then the RadASM default is called otherwise it will treat it as if it was found in the keyword list of whatever you specified in "default". For now I have added it manually but I thought you might like to include it as an option, I really hate the old Win32.hlp file, it's missing all the interesting stuff.
Posted on 2004-06-11 19:08:10 by donkey
I was wondering what the combo was for You should increase the height so it will drop down, right now the only way to use it is to select the current item and use the arrow keys. Everything else seems to work fine right now.

I don't understand... it drops down just fine over here??? I'm running Windows XP SP1.

You are using lstrcmp. It is slow and a little too inteligent. In Norway AA is sorted as ?

Drat... looks like I'm not getting away with taking the easy route ;) Oh well. You know of any good replacements laying around?

Added a default help that will check the RadASM.INI file for the appropriate file...

I'll add this code, thanks! I don't think it'd be too hard to add this to the options dialog as well.
Posted on 2004-06-12 03:20:56 by Qweerdy
Hi Qweerdy

This is a direct replacment of lstrcmp.


strcmp proc uses esi edi,lpStr1:DWORD,lpStr2:DWORD

xor ecx,ecx
mov esi,lpStr1
dec ecx
mov edi,lpStr2
@@:
inc ecx
mov al,[esi+ecx]
sub al,[edi+ecx]
jne @f
cmp al,[esi+ecx]
jne @b
@@:
cbw
cwde
ret

strcmp endp


KetilO
Posted on 2004-06-12 04:02:20 by KetilO
Hi Qweerdy

Yes the combo works on XP but not on Win98. Just set the size with RadASM's dialog editor. Also adding scrollbars is a good idea.

KetilO
Posted on 2004-06-12 05:36:16 by KetilO
Hi Qweerdy,

If you close the dialog with the CLOSE button it can cause RadASM to stop responding, you must terminate a dialog with EndDialog...

.elseif eax==WM_CLOSE

invoke DestroyWindow,hWnd


Should be...

.elseif eax==WM_CLOSE

invoke EndDialog,[hWnd],NULL
Posted on 2004-06-12 11:33:06 by donkey
Hi Qweerdy

Here is an example that reads and sorts kwl files. Maybe you can use parts of it.
It's fast, uses only 5ms on my 500Mhz PIII.

KetilO
Posted on 2004-06-12 15:56:44 by KetilO
Okay, the new version is ready.

Changes:

- Default category is now implemented
- Fixed combobox problem in setting dialog
- Fixed hang problem when using close button in settings dialog
- Settings dialog sometimes forgot to ask if you wanted to save. This has been fixed.
- AddinManager settings are available
- It uses strcmp instead of lstrcmp for comparing strings
- Listview control in the settings dialog is much better:
* It now scrolls vertically instead of horizontally
* It clips long filenames, and displays the full name in a tooltip if you hover the mouse over a clipped item.


Please report any bugs, feature requests are okay too although I don't know when I'll be able to implement them. I'm pretty busy at the moment since I've got a full-time vacation job during the weeks and full time parties during the weekend since I graduated last Friday :) (With a 8/10 average, I might add :grin: :rolleyes: )
Posted on 2004-06-20 12:55:16 by Qweerdy
Hi Qweerdy,

Congratulations on graduating.

The Addin does not find anything in the winapi.kwl file. I tested using this...

.elseif edx==IDM_HELPF1

invoke GetKeyword,addr kwbuf
.if eax
invoke FindKeyword,addr kwbuf
.if eax
push eax
invoke MessageBox,NULL,addr kwbuf,eax,MB_OK
pop eax
invoke OpenHelp,addr kwbuf,eax
ret
.endif
.endif
.ENDIF


Then hilited MessageBox and pressed F1, the message box did not open indicating that the keyword was not found. For the test I deleted and rebuilt the cache file and used the kwl files from your distro, I verified that messagebox was in the cache. The addin found the other keywords from other KWL files just fine however not a single API was found and the default was not called. Any ideas on why it did not find the winapi ones ? The DLL reports version 0.3.2.0, RadASM version 2.0.4.3 (b)
Posted on 2004-06-20 13:21:05 by donkey
To reproduce your problem I had to rebuild the cachefile, indicating the problem is somewhere in the RebuildCache proc. I'll try to get it fixed tonight.
Posted on 2004-06-21 11:35:33 by Qweerdy
It's fixed now, I think. The new strcmp was breaking the sorting in a very subtle way. The problem was that I was relying on a quirk of the microsoft-specific implementation instead of the standard C strcmp specification (MS's strcmp always returns -1, 0, or 1, while C strcmp can return any value).

Don't forget to rebuild the cachefile (delete the *.tmp files in the addin dir).

Donkey: This release also contains your expanded winapi.kwl.
Posted on 2004-06-21 12:42:07 by Qweerdy
Hi Qweerdy

Just a few notes.



.ELSEIF eax==AIM_CLOSE
.if IDAddIn
mov eax,lpHandles
invoke DeleteMenu,(ADDINHANDLES ptr [eax]).hMenu,IDAddIn,MF_BYCOMMAND
mov IDAddIn,0
.endif


By handling AIM_CLOSE and delete your menu entry, you prevent duplicate menu entries when addin-manager is used to set options.



.ELSEIF eax==AIM_MENUREBUILD
invoke CloseCache
invoke OpenCache


By handling AIM_MENUREBUILD instead of AIM_PROJECTOPENED you also set correct help files when Project / Set Assambler is used.

KetilO
Posted on 2004-06-22 03:07:32 by KetilO
Works flawlessly Qweerdy :alright:

You might like to include my GoAsm.kwl file in the distro as well, we're not all MASM users after all :grin:
Posted on 2004-06-22 03:18:09 by donkey
I finally got around to adding KetilO's bugfixes. The new zip is also better organised, and I added donkey's GoAsm.kwl.

This version is the "final release" version for now. MsdnHelp is now officially obsolete.

KetilO and donkey, thanks a lot for your testing :alright:
Posted on 2004-07-12 04:08:16 by Qweerdy