It is easy to make his code work on a GUI application easily:
1. Create a function possibly a DWORD and put the network stuff there. Make sure it is position independent.
2. Then use CreateThread() to call the postion independent function.This way it will turn into a Thread rather than a functions so the EIP will continue to move on to the next Binary while the thread is executing as well due to windows construction . So the GUI will be working very fast and responsive.