Hi
i checked the B4J source code , but the only way for a Device to call the server is through email and not from a GCM message .
To send a message you need the api key and the device id ,the server is a b4j app and doesn't has a device id
I'm sorry I misread your original question. I thought that you want to send a GCM message to another device from the device.
You cannot use GCM to send messages to the desktop. However there are many other simpler ways to send a message to a desktop server (assuming that the network is configured correctly).
My first B4A app does this using Apache web server configured with PHP and MySQL. The app sends messages to a Raspberry PI that controls the opening and closing of my gate at the end of my driveway. The PI also tells me when someone is at my gate by using motion detection seen through the outdoor web cam attached to the PI.
Like Erel said, there are easier ways.