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.

MPC-Home Fullscreen window state status?

If you have a question or need help, this is the place to be.
Post Reply
molitar
Experienced User
Posts: 209
Joined: Fri Sep 11, 2009 6:44 am

MPC-Home Fullscreen window state status?

Post by molitar »

Currently for my windows state I am using the script below.

Code: Select all

from win32gui import GetWindowPlacement

#SW_SHOWNORMAL = 1
#SW_SHOWMINIMIZED = 2
#SW_SHOWMAXIMIZED = 3

FindWin = eg.WindowMatcher(None, None, u'MediaPlayerClassicW' , None, None, None, True, 0.0, 0)
hwnd = FindWin()

def GetWindowStatus(hwnd):
    showList  = (None, "Normal", "Minimized", "Maximized")
    placement = GetWindowPlacement(hwnd)
    #unrem the below line to display the placement values that you need for the if placement[4] line
    print placement
   
    if placement[4] == (-1920, 1048, 0, 2128):
        return "Fullscreen"
    else:
        return showList[placement[1]]

eg.globals.WindowsState = GetWindowStatus(hwnd[0])
print "Windows State = " + eg.globals.WindowsState
Works good but if I make any change in screen settings than I need to change the placement values. Now I am using show fullscreen on another display so is it possible to modify script to see if the display is showing on display 1 or display 2? Or any other method how I can check the window state for fullscreen? I am using this to determine where to show the OSD for volume controls or menus to display on.
Post Reply