From what I understand this line basically tells the program to wait forever. For my purposes it seems to be working. However, I'd like to be able to end the program given the right stimulus. How would one go about ending the above line, or stopping the program from running any further.
According to these docs,
Pumps all messages for the current thread until a WM_QUIT message.