On 12/30/18 02:54, Hamish Claxton wrote:
Hi Fabian,
Yes, this only hides the tray when it should. The code only happens on the WM_DISPLAYCHANGE event, which occurs on resolution changes. I wouldn't write any code that would damage any existing features.
While the resolutions shouldn't differ, actually the SM_CYFULLSCREEN reports a larger dimension by 11. What happens is beforehand, the systray was getting drawn no matter what on a resolution update. This patch checks if the current foreground game is covering the entire screen, hence covering the area where the systray would normally be drawn, which is also the entire desktop resolution, and if it is, does not draw the systray.
I tested this patch thoroughly and it only enhances existing functionality.
Thanks in Advance, Hamish
GetSystemMetrics, as its name implies, gives system metrics (constants) and not that of the current foreground game as you want. It will always apply. Furthermore, this doesn't handle situation with multiple displays.
You probably want to check if there's a full screen window somehow, or use MonitorFromWindow / GetMonitorInfo / GetWindowRect and compare, but I don't know if that's a good way to go about this.