metastatik
2008-05-19 02:38:38
I’ve finally figured out how to (minimally) use WM_Messages with MT and thought it was worth posting since there really isn’t much info on it. I’m sure a lot of things are possible with these, but I just have WM_Command working so far. This lets me select menu items (like Edit->Freeze Track) from the app I’m controlling, whether it’s active or in the background. I’ve tested this with Live, Reason, MS Word and MT itself. It works with all, except Word…so YMMV.
FINDING WM_COMMANDS FOR YOUR APP
1. Download and install Winspector Spy.
2. Open the app you want to control.
3. Open Winspector Spy.
4. In the Window List (left side panel), find the app you want to control and right-click it.
5. Choose Message and a Message window will appear in the right panel.
6. Right-click on the Message window and select Edit Message Filter.
7. Click Filter All. Then find WM_Command and double-click it to unfilter it. Then click Ok.
8. Click the Always on Top button…it’s the button right under the File menu.
9. Now click on a menu item in your app.
10. You should now see a WM_Command message in the Message window. If you don’t, then it’s not going to work. (This was the case with Word.).
11. Click the plus sign next to the WM_Command and find the Control ID…should be a number like “41949”.
12. Lastly, you need the class of your app. You can find that by clicking on your app and looking in the lower right hand corner of Winspector, in the Class box. To give you an example, Live’s class is “Afx:00400000:0:00000000:01900015:00000000”. Reason’s class is “IglooDocumentWindow”.
USING WM_COMMANDS IN MT
1. Check Match By Class and put in the class you got from Step #12.
2. For Message ID, type “273” in the Numerical box.
3. For WParam, use the number you got from Step #11. LParam stays at 0.
Does anyone else have any tips on using WM_Messages?
FINDING WM_COMMANDS FOR YOUR APP
1. Download and install Winspector Spy.
2. Open the app you want to control.
3. Open Winspector Spy.
4. In the Window List (left side panel), find the app you want to control and right-click it.
5. Choose Message and a Message window will appear in the right panel.
6. Right-click on the Message window and select Edit Message Filter.
7. Click Filter All. Then find WM_Command and double-click it to unfilter it. Then click Ok.
8. Click the Always on Top button…it’s the button right under the File menu.
9. Now click on a menu item in your app.
10. You should now see a WM_Command message in the Message window. If you don’t, then it’s not going to work. (This was the case with Word.).
11. Click the plus sign next to the WM_Command and find the Control ID…should be a number like “41949”.
12. Lastly, you need the class of your app. You can find that by clicking on your app and looking in the lower right hand corner of Winspector, in the Class box. To give you an example, Live’s class is “Afx:00400000:0:00000000:01900015:00000000”. Reason’s class is “IglooDocumentWindow”.
USING WM_COMMANDS IN MT
1. Check Match By Class and put in the class you got from Step #12.
2. For Message ID, type “273” in the Numerical box.
3. For WParam, use the number you got from Step #11. LParam stays at 0.
Does anyone else have any tips on using WM_Messages?