some window utility functions