the payload of the event is an object that can perform many tasks on a window. one of them being getting the size. as an example of a python script to do this.
Code: Select all
from eg.WinApi.Utils import GetMonitorDimensions
window = eg.event.payload
rect_tuple = window.GetRectTuple()
for i, screen_tuple in enumerate(GetMonitorDimensions()):
if tuple(screen_tuple) == rect_tuple:
print '{0} is in fullscreen mode on monitor {1}'.format(window.title, i + 1)
break
else:
print '{0} is not in fullscreen mode, it has a size of {1}x{2}'.format(window.title, *rect_tuple[2:])
Code: Select all
eg.globals.some_window = eg.event.payload
Code: Select all
eg.globals.some_window = None
Code: Select all
from eg.WinApi.Utils import GetMonitorDimensions
window = getattr(eg.globals, 'some_window', None)
if window is None:
print 'The window is not open'
else:
rect_tuple = window.GetRectTuple()
for i, screen_tuple in enumerate(GetMonitorDimensions()):
if tuple(screen_tuple) == rect_tuple:
print '{0} is in fullscreen mode on monitor {1}'.format(window.title, i + 1)
break
else:
print '{0} is not in fullscreen mode, it has a size of {1}x{2}'.format(window.title, *rect_tuple[2:])