I've compiled this on my system and it tells me that the application is waiting for signals 0x40000000 to arrive.
Dave G
Edit: In fact if you comment out this line
signals = Wait(window_signal);
You will find the ball will bounce left and right as you wanted it to. BUT you can't close the window and on my OS3.9 4000D it will crash when killing the program.