OR, if you want to duplicate the action which is also available in some menu in Messenger, simply use a resource editor, like
Resource Hacker, and check the menu resources. The cmd_id will be listed in plain sight there:
- Launch your favorite resource editor
- Open the language file of Messenger (eg: msgslang.8.5.1302.1018.dll)
- Select the 'Menu' resource table
- Search for the text of the menu item which action you want to duplicate
Note: don't forget to include the ampersand (&) in your search text
- Locate the cmd_id
eg:
=> thus, the cmd_id for setting your status to busy is 40168.
This method is much quicker and requires less knowledge. But it will only work if the action you want to duplicate is available somewhere in some menu.