How do I determine the height and orientation of the taskbar in Windows using automatic printing?

I am using Qt, what I want to do is display a custom popup above the system tray icon in Windows. I can get the coordinates of the icons using geometry () and taskbar height by finding the difference between screenGeometry () and available geometry (). This way, the popup can be properly anchored and not overlap the taskbar for different taskbar orientations (for example, when the taskbar is on the left side or at the top of the screen).

The problem starts when automatic taskbar printing is enabled and then appears to be available. Geometry returns the same value as screenGeometry and I can't find the height of the taskbar anymore. This causes the popup to overlap with the taskbar or even appear in the wrong place.

My question is, how can I correctly determine the orientation and size of the taskbar in Windows when the auto-update feature is enabled? Should I use some winapi function, or can I do this exclusively in Qt (preferred)?

+3


source to share


1 answer


1) The Autohide state you are checking using this: http://msdn.microsoft.com/en-us/library/bb787947(v=vs.85).aspx 2) And find the width / height / orientation using this : http://msdn.microsoft.com/en-us/library/bb787953(v=vs.85).aspx



Hope this helps. Yes, these are WinAPI functions, so you should only use this code in "#ifdef Q_OS_WINDOWS" - if you want to compile on Linux as well.

+3


source







All Articles