Slaya:
There are several ways which you could go about this.
SetWinEventHook could be used, but this would probably be tricky to determine the WM_COMMAND parameter, and might have mixed reliability (ie. buttons versus menus, etc.)
However if you can just get away with monitoring button clicks, etc. by EVENT_OBJECT_INVOKED, then this requires no dlls, and has minimal performance/stability issues.
A message hook using the hook.dll could be used, but this will likely cause noticeable performance issues.
I seem to remember that there is a get message hook as well? But I am not sure whether it would be suitable...
You could also inject a dll into the process and sub(super?)class the window procedure(s), but that would require another specialised dll, this would avoid the performance issues.
If autohotkey integration is not necessary, I would seriously suggest that you use SPY++ or similar.
PS. I would usually do some more basic research before posting, but as I am currently using a machine epic in its antiquity, where even browsing and typing is a trial, and I am tired, I can do without another saga of hangs and page faulting sprees, until I can use the better machine tomorrow... (This is a pentium pro running win98 with 80MB RAM). I've spent half an hour already on this post
