def get_titlebar_height(self): return (user32.get_system_metrics(user32.SM_CYFRAME) + user32.get_system_metrics(user32.SM_CYCAPTION) + user32.get_system_metrics(user32.SM_CXPADDEDBORDER))
def adapt_window_rect_to_title_bar(self, rect): rect.top += (user32.get_system_metrics(user32.SM_CYFRAME) + user32.get_system_metrics(user32.SM_CYCAPTION) + user32.get_system_metrics(user32.SM_CXPADDEDBORDER)) rect.bottom -= user32.get_system_metrics(user32.SM_CXBORDER)
def is_logical_left_button_down(): buttom_swap = bool(user32.get_system_metrics(user32.SM_SWAPBUTTON)) virtual_key = user32.VK_LBUTTON if buttom_swap: virtual_key = user32.VK_RBUTTON return user32.get_async_key_state(virtual_key) < 0