Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
WindowState? If fullscreen do A. If not do B.
WindowState? If fullscreen do A. If not do B.
The title says it.
I'd like a script/macro that will look at the window size (full size/maximized or not) for XBMC, MPC, WMC etc. If the window is full screen it fires one macro. If it is not full screen it fires a different macro.
Btw...
Searched much couldn't find any results.
Thanks.
I'd like a script/macro that will look at the window size (full size/maximized or not) for XBMC, MPC, WMC etc. If the window is full screen it fires one macro. If it is not full screen it fires a different macro.
Btw...
Searched much couldn't find any results.
Thanks.
eventghost.net
Be there or be square.
Be there or be square.
Re: WindowState? If fullscreen do A. If not do B.
Whowww! I'm so surprise that somebody have the same question!!!
I'm trying to do something without script but there is no solution.
I'm so exited, and I'm waiting for the solution.
Thank you for your help.
I'm trying to do something without script but there is no solution.
I'm so exited, and I'm waiting for the solution.
Thank you for your help.
Re: WindowState? If fullscreen do A. If not do B.
Hello,
I've got the same problem. Is there a solution? I'm really interesting by this.
Regards...
I've got the same problem. Is there a solution? I'm really interesting by this.
Regards...
Re: WindowState? If fullscreen do A. If not do B.
Hello,
Is there a problem with the forum? I try to answer to this post but nothing happen.
Can you explain to me?
Thank you.
Is there a problem with the forum? I try to answer to this post but nothing happen.
Can you explain to me?
Thank you.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: WindowState? If fullscreen do A. If not do B.
I know, why you got no answer.zian wrote:The title says it.
I'd like a script/macro that will look at the window size (full size/maximized or not) for XBMC, MPC, WMC etc. If the window is full screen it fires one macro. If it is not full screen it fires a different macro.
On your question nobody knows the answer. There is no universal way.
I personally know only how it is with MPC-HC.
The answer you find, when you look at the code of MPC-HC plugin.
Pako
Re: WindowState? If fullscreen do A. If not do B.
I'm bummed.On your question nobody knows the answer. There is no universal way.
Thanks for the info Pako.
eventghost.net
Be there or be square.
Be there or be square.
Re: WindowState? If fullscreen do A. If not do B.
see if this will help...
http://pywinauto.sourceforge.net/
look into python's win32gui methods
also, I was thinking you might be able to get the window's dimensions and check it against the desktop resolutions... if they match, the app window should be full screen, if they don't it would not be
if you cannot find a way to do it in Python, you might be able to write a mini app to do it and pass the result back to Python...
http://www.daniweb.com/software-develop ... ads/202569
http://stackoverflow.com/questions/5531 ... ode-behind
http://pinvoke.net/default.aspx/Enums/S ... mmand.html
http://pywinauto.sourceforge.net/
look into python's win32gui methods
also, I was thinking you might be able to get the window's dimensions and check it against the desktop resolutions... if they match, the app window should be full screen, if they don't it would not be
if you cannot find a way to do it in Python, you might be able to write a mini app to do it and pass the result back to Python...
http://www.daniweb.com/software-develop ... ads/202569
http://stackoverflow.com/questions/5531 ... ode-behind
http://pinvoke.net/default.aspx/Enums/S ... mmand.html
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: WindowState? If fullscreen do A. If not do B.
Right now, I just thought of something.
It is possible to reformulate the task as follows ?
If some window of some program is just full screen and is on top, do A, otherwise do B.
If so, then it would probably be possible to find universal solutions.
Otherwise, it is not possible, because for each program this window (= FullScreen) is called differently and the biggest problem is to find the name and class name of this window.
Pako
It is possible to reformulate the task as follows ?
If some window of some program is just full screen and is on top, do A, otherwise do B.
If so, then it would probably be possible to find universal solutions.
Otherwise, it is not possible, because for each program this window (= FullScreen) is called differently and the biggest problem is to find the name and class name of this window.
Pako
Re: WindowState? If fullscreen do A. If not do B.
I'm really interested by this subject but I'm not programmer.
The problem is to big for me.
I hope that you'll find a solution.
Good luck.
Regards...
The problem is to big for me.
I hope that you'll find a solution.
Good luck.
Regards...
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: WindowState? If fullscreen do A. If not do B.
I found a solution:Python Script:But I do not know if it will be reliable in practice and whether it will work in all cases that you need.
I tried only MPC-HC and WMP.
Pako
Code: Select all
from win32gui import GetForegroundWindow, GetWindow, GetWindowRect
from win32api import EnumDisplayMonitors
GW_CHILD = 5
GW_HWNDNEXT = 2
def GetFullScreen():
fullscreen = False
mons = EnumDisplayMonitors()
hwnd = GetForegroundWindow()
rect = GetWindowRect(hwnd)
for mon in mons:
if rect == mon[2]:
fullscreen = True
break
if not fullscreen: # maybe some child ?
child = GetWindow(hwnd, GW_CHILD)
while child > 0:
childRect = GetWindowRect(child)
for mon in mons:
if childRect == mon[2]:
fullscreen = True
break
if fullscreen:
break
child = GetWindow(child, GW_HWNDNEXT)
return fullscreen
eg.result = GetFullScreen()I tried only MPC-HC and WMP.
Pako
Re: WindowState? If fullscreen do A. If not do B.
Hello,
I'm a novice, can you explain to me how to create the script? I create a *.txt file with the lines you give us and I save it to *.py?
This is this?
I'm a novice, can you explain to me how to create the script? I create a *.txt file with the lines you give us and I save it to *.py?
This is this?
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: WindowState? If fullscreen do A. If not do B.
No, you need no *. py file.FCB38 wrote:I'm a novice, can you explain to me how to create the script? I create a *.txt file with the lines you give us and I save it to *.py?
This is this?
You simply add to your configuration the action Python Script.
Once you put the action, opens a simple text editor.
There you paste (or write) a script and confirm OK.
Pako
Re: WindowState? If fullscreen do A. If not do B.
Hello,
It seems to work perfectly. Not with a window from the Windows Explorer; like I wanted.
Thank you very much.
It seems to work perfectly. Not with a window from the Windows Explorer; like I wanted.
Thank you very much.
Re: WindowState? If fullscreen do A. If not do B.
(((((Pako)))))
Works like a charm.
Thanks VERY much.
btw...
I use this so I can either A..."un-fullscreen" a window and then open up my docked magnify.exe
or
B... first close/exit magnify.exe and then do fullscreen (of XBMC - WMC - MPC-HC etc.)
I LOVE IT.
Works like a charm.
Thanks VERY much.
btw...
I use this so I can either A..."un-fullscreen" a window and then open up my docked magnify.exe
or
B... first close/exit magnify.exe and then do fullscreen (of XBMC - WMC - MPC-HC etc.)
I LOVE IT.
eventghost.net
Be there or be square.
Be there or be square.
Re: WindowState? If fullscreen do A. If not do B.
Nice work Pako... that would make a nice plug-in *hint, hint* 
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system