I've just tried using the RRSDK VB app to try to remotely exit RR from VB. If I open the code and run the example you give VB closes immediately.
If I comment out:
It will run ok, but obviously nothing will work, any ideas?? Have tried both with and without RR running, I'm running VB6 SP6.
Private Sub Form_Load()
'Prepare to receive messages
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'Unhook message API