Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disable macro in full screen
#1
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.
#2
Get window handle and call this function. If returns 1, let the macro exit.

Function IsFullScreenWindow
Code:
Copy      Help
;/
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


Forum Jump:


Users browsing this thread: 1 Guest(s)