Using WM_Messages with MT Pro

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?

joesapo

2008-05-19 09:18:23

This is an excellent writeup. Thanks for posting this!

Unfortunately I don't have many tips myself for using WM_ Messages, as I've only begun to work with them myself. I'm definitely going to be looking into the software you suggested tho.

joe :mrgreen:

florian

2008-05-19 11:12:24

Hi Metastatik,

excellent! thanks, too, for posting this. Using WM messages was a customer feature request, but I haven't done much with it either, yet.

One more explanation: 273 in the "Message ID" field is the code for WM_COMMAND. There are other WM messages, e.g. WM_APPCOMMAND (code 793)...

Cheers,
Florian

metastatik

2008-05-31 22:44:18

Thanks for pointing that out, Florian.

fanboi

2008-08-04 14:42:10

wah, useful info to say the least!
thanks.

fanboi

2008-08-12 23:13:19

just figured that id drop by to say that i for one would love a list of wm messages and their respective ids.

florian

2014-06-23 16:42:45

Note: we plan to remove support for WM_ messages in the next version of MIDI Translator Pro. Please post here if you currently use it and describe for what you use it. We can then try to add equivalent functionality.
Florian

etl17

2014-07-07 22:52:49

Hi florian,

I currently use WM_COMMAND to control Cubase, Digital Performer and RME TotalMix menu triggers.
I could probably survive Cubase and DP using keyboard shortcuts and sending keystokes from MT Pro, but I'm not sure if I can do the same for TotalMix. Also, it seems that removing this functionality will severely limit the capabilities of the application, unless if you provide other means to send Windows messages to applications.

Just my $0.02

--Stefanos.

etl17

2014-07-08 17:05:33

Hi florian,

Yes, I am using the WM_messages functionality to control Cubase, Digital Performer and the RME TotalMix application. It seems to be a very powerful feature that I would hate losing! Is there a specific reason that you are considering to remove it? Would the scripting language provide similar capabilities?

florian

2014-07-08 22:18:08

Hi Stefanos,

thanks for letting me know. It's a powerful feature, but rather clumsy to use and requires some programming knowledge. It does not fit well into MT's primary target groups (musicians, performers, sound engineers, electrical engineers, ...). We're not actively throwing it out; the next version of MT is written from scratch and the WM_ message feature was left out in the transition.

We believe that only a few users use it. And if they use it, they use it for very specific use cases. So we'd rather find out how it's used and create specific action types for those use cases. Then those action types can work on OS X, too.

Regards,
Florian

PS: would you mind posting or sending me by email your preset with the COMMAND messages?

etl17

2014-07-09 03:28:42

Hi Florian,

Yes, I see your point.
I put together a super simple preset that demonstrates how I use the functionality in bigger presets. In this case this preset will simulate clicking on the "Enable MIDI control" menu item in RME TotalMix.
example.bmtp
Example WM_COMMAND message to TotalMix
(758 Bytes) Downloaded 217 times
Depending upon what scripting environment you are thinking to embed in the next version of MT Pro, you may think of providing the ability to either send messages or allow for custom extensions to the available scripting functions (so the community can provide enhancements).

Thank you again for a great product! Looking forward to the next Windows version,

Stefanos.