Alter the commands that are sent to the user through the Ajax framework.
$commands: An array of all commands that will be sent to the user.
function hook_ajax_render_alter($commands) {
// Inject any new status messages into the content area.
$commands[] = ajax_command_prepend('#block-system-main .content', theme('status_messages'));
}