Thank you.
The code some-what working, but not with every fullscreen applications. For example in some cases it still fails recognize WMP (Windows Media Player) or firefox (via F11 key), but it works fine on PotP...
P.S.
In code from the original topic seems to be bad logic when checking if window is maximized. Instead of
js code:
if(!Interop.Call('user32', 'IsWindowVisible', hWnd) || Interop.Call('user32', 'IsIconic', hWnd) || !Interop.Call('user32', 'IsZoomed', hWnd))
it should be:
js code:
if(!Interop.Call('user32', 'IsWindowVisible', hWnd) || Interop.Call('user32', 'IsIconic', hWnd) || Interop.Call('user32', 'IsZoomed', hWnd))