I never could get it to close properly until I installed autohotkey & mapped one of my buttons to the esc key.
http://www.autohotkey.com/I mapped the middle mouse button (unused on my x-arcade tankstick) to esc using the following script-
MButton::escape
Create a shortcut to the script, right click to copy it, then paste it in the startup folder.
(right click start>explore all users>programs>startup)
This will launch the script with windows and a middle mouse button click with post as the ESC key.
This has fixed every emulator I had trouble exiting.
I learned just enough about autohotkey to get that done and nothing more, so I probably won't be able help you with it anymore than that.

Or....
If you can tolerate it running windowed instead of fullscreen, I found that works also.