Posts: 69
Threads: 42
Joined: Jun 2006
I would need that a macro should automatically not work in my browser when it is in full screen mode.
It should automatically work again when I am no more in full screen.
The browser I am using is Vivaldi, that is based on Chrome.
Posts: 12,095
Threads: 142
Joined: Dec 2002
Get window handle and call this function. If returns 1, let the macro exit.
Function
IsFullScreenWindow
;/
function! w
;Returns 1 if window w is full-screen, 0 if not.
;w - window handle.
RECT r, rc, rm;
if(!GetWindowRect(w &r)) ret
int cx(r.right - r.left) cy(r.bottom - r.top)
if(cx < 400 || cy < 300) ret
GetClientRect w &rc
if(rc.right != cx || rc.bottom != cy)
,if(cx - rc.right > 2 || cy - rc.bottom > 2) ret
MONITORINFO m.cbSize=sizeof(m)
if(!GetMonitorInfo(MonitorFromWindow(w 0) &m)) ret
rm = m.rcMonitor
if(r.left > rm.left || r.top > rm.top || r.right < rm.right || r.bottom < rm.bottom - 1) ret
int ws=GetShellWindow
if(w=ws || GetWindowThreadProcessId(w 0)=GetWindowThreadProcessId(ws 0)) ret
if(w == GetDesktopWindow) ret
ret 1