build switch case for the window control