Ok, thank you for replying. I am doing this right now and I think it is working (haven't done final testing yet):
// to ensure that the window is closed down...
while(HWND switchWindow = FindWindowEx(NULL, NULL, NULL, "switch"))
{
SendMessage(switchWindow, WM_CLOSE, 0, 0);
}