There
is an api. I've used it before. And there's also Add-ins.
You can use WM_COMMAND to change statuses if one of the windows is open.
If not, you'll need to send messages to MsnHiddenWindowClass telling that: you opened the tray menu, selected the My Status box, opened that menu, and selected the right status (this is because the MsnHiddenWindowClass doesn't interpret WM_COMMAND messages.)