Not so much a programming question as an IDE question.
Is there any way one can cancel the upload?
I tend to use the IDE serial monitor, but have to change the port. Sometimes I then attempt uploading while still pointing to the wrong port and need to shut down the IDE and unplug the usb to my programmer before I can get access to that port again.
• Press CtrlAltDel
• Click Start Task Manager
• Select the Processes tab
• Click Image Name to sort the list alphabetically
• Locate and select avrdude
• Click End Process
• Click End Process
• Close Task Manager (in addition to the normal ways to close it, pressing Esc also works)
The Arduino IDE recovers gracefully allowing you to easily return to your business.