如何使用 Python/PyQT/Win32 获取 Windows 任务栏的高度 [英] How to get the height of Windows Taskbar using Python/PyQT/Win32
问题描述
我正在尝试使我的 GUI 程序与 Windows 屏幕的右下角对齐.当任务栏没有隐藏时,我的程序只会站在任务栏的顶部!
I am trying to make my GUI program align to the bottom-right of the screen on Windows. When the taskbar is not hidden, my program will just stand on top of the taskbar!
在使用 Python/PyQT/Win32 时,我该怎么做:
When using Python/PyQT/Win32, how can I:
- 检查任务栏的自动隐藏功能是否开启
- 获取任务栏的高度
推荐答案
我认为您需要致电 GetMonitorInfo 用于感兴趣的监视器.然后,您需要从 MONITORINFO.rcWork 中读取工作区.这将排除为任务栏保留的监视器的任何部分,甚至任何其他保留区域.
I think you need to call GetMonitorInfo for the monitor of interest. You then need to read the work area out of MONITORINFO.rcWork. This will exclude any part of the monitor reserved for taskbar and indeed any other reserved areas.
我认为您不需要担心自动隐藏,因为 GetMonitorInfo 应该考虑到这一点.换句话说,当启用自动隐藏时,工作区将等于监控区.
I don't believe you need to worry yourself about autohide because GetMonitorInfo should account for that. In other words when autohide is enabled the work area will equal the monitor area.
这篇关于如何使用 Python/PyQT/Win32 获取 Windows 任务栏的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!