How do you Close a window that's not your thread, destroywindow doesn't work (it only works on your thread) and Sending a WM_CLOSE message doesn't work on IE windows
Try WM_SYSCOMMAND with wParam set to SC_CLOSE.
Sending a WM_CLOSE message doesn't work on IE windows
Don't you just love how MS write the APIs, and set up a standard way for apps to work, then go and do something completely different with their own apps?