Combined the two platform specific window handle methods.