Extract code that posts message to other process