"Add Object Models to Non-COM Apps"
by Dino Esposito
Visual Studio Magazine, March 2002 [online exclusive]


Here's a VBScript sample to test the object model described in the article. 
I use a modified version of the DLL described in my VCDJ article "Hook, Line and Sinker". 
That sample code spawns, hooks and then subclasses Notepad. 
It filters all the messages the window receives and pops up a dialog box with the command IDs 
whenever the command code is WM_COMMAND. 
What you need to add is only the code necessary to store or display the command code. 

Legend:

New = 9
Open = 10
Save = 1
SaveAs = 2
PageSetup = 32
Print = 14
Exit = 28
Find = 3
SelectAll = 7
WordWrap = 27
Font = 37