How Not To Do It... F IT. It works for me.

If you have macros or EventGhost Configuration Tree items you wish to share this is the place to do it.
Post Reply
User avatar
zian
Site Admin
Posts: 533
Joined: Wed Jun 24, 2009 3:54 pm

How Not To Do It... F IT. It works for me.

Post by zian » Wed Nov 22, 2017 5:48 pm

If we had a Hacked & Cobbled & Years Worth of Old Code & Obsolete Macro Eventghost Tree Contest I think I might win.
LOL

This code has been in my tree since Pako made the python script years and years ago.
It was x-ed out and unused until today.

Hoarding/bad housekeeping can have it's advantages.
:)

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="0.5.0-rc4">
    <Folder Name="Fullscreen FF" XML_Guid="{7A7056BD-7B87-456C-8084-3A1BFB3BF825}" Expanded="True">
        <Macro Name="MCE7 Small" id="398" XML_Guid="{BB1A1F34-00FD-434F-9E44-A4A859F6108D}">
            <Event Name="HauppaugeIR.PAUSE" XML_Guid="{F84A6D2D-A583-4849-802A-52FB3FFE9A3F}" />
            <Action Enabled="False" XML_Guid="{A92D4B0C-7632-4CAC-A9C0-FD8FDC1B189F}">
                EventGhost.DisableItem(XmlIdLink(398))
            </Action>
            <Action Enabled="False" XML_Guid="{D0D247A7-42B2-4443-8B70-DB0BE73B121F}">
                EventGhost.EnableItem(XmlIdLink(412))
            </Action>
            <Action XML_Guid="{EBFF52C4-F202-42CC-A1D0-F348E99DF7C8}">
                EventGhost.NewJumpIf(XmlIdLink(412), 1, False)
            </Action>
            <Action XML_Guid="{D84F5F72-4876-4E9A-A5FC-CD3B28B994FD}">
                Window.FindWindow(u'Magnify.exe', None, None, None, None, None, False, 0.0, 0)
            </Action>
            <Action XML_Guid="{82F6E35C-AB12-4780-9826-B1323194C67F}">
                Window.Close()
            </Action>
            <Action XML_Guid="{0554E347-B239-4DF8-A4FE-81E39785A967}">
                EventGhost.Wait(0.3)
            </Action>
            <Action XML_Guid="{BFFE6703-4721-4AFA-AD58-898079462E95}">
                Window.FindWindow(u'ehshell.exe', None, None, None, None, None, False, 0.0, 0)
            </Action>
            <Action XML_Guid="{26F0EFB2-568A-4F8E-B0A7-A0D471CFEB1C}">
                Window.BringToFront()
            </Action>
            <Action Enabled="False" XML_Guid="{27A2B87A-56F6-4951-AA5D-8104415B9ED0}">
                Window.SendKeys(u'{Alt+Return}', False)
            </Action>
            <Action Enabled="False" XML_Guid="{1965D7CF-AB60-4B2B-9832-BB1ADC888498}">
                Window.Maximize()
            </Action>
            <Action Enabled="False" XML_Guid="{32BAABF2-71B2-4E5C-8282-96D03CB54EEF}">
                Window.FindWindow(u'osk.exe', None, None, None, None, None, False, 0.0, 0)
            </Action>
            <Action Enabled="False" XML_Guid="{B6CEA494-B888-402F-A856-20915DBF2FD1}">
                Window.Close()
            </Action>
        </Macro>
        <Macro Name="MCE7 Big" id="412" XML_Guid="{D253D058-7D15-4B05-A325-2002E405B809}">
            <Action XML_Guid="{43602748-AAA0-4112-B01F-19581AF3AF95}">
                Window.SendKeys(u'{Alt+Return}', False)
            </Action>
        </Macro>
        <Macro Name="Python Script" XML_Guid="{F00FC2E5-7E0A-406F-8135-D72D4A50CD33}" Expanded="True">
            <Event Name="X10.Pause" XML_Guid="{03D57FFA-3206-451F-B894-86488234D130}" />
            <Event Name="MouseEvent.Wheel.Up" Enabled="False" XML_Guid="{D4D23678-14F5-45BF-B5EE-BE7BF52E0E17}" />
            <Event Name="MouseEvent.Middle.Up" XML_Guid="{C1D299EB-AB1D-40F1-A364-BBAA568281BC}" />
            <Action XML_Guid="{EFF9FD6E-87AA-4592-9759-9B6815011B57}">
                EventGhost.PythonScript(u'from win32gui import GetForegroundWindow, GetWindow, GetWindowRect\nfrom win32api import EnumDisplayMonitors\nGW_CHILD         = 5\nGW_HWNDNEXT      = 2\n\ndef GetFullScreen():\n    fullscreen = False\n    mons = EnumDisplayMonitors()\n    hwnd = GetForegroundWindow()\n    rect = GetWindowRect(hwnd)\n    for mon in mons:\n        if rect == mon[2]:\n            fullscreen = True\n            break\n    if not fullscreen: # maybe some child ?\n        child = GetWindow(hwnd, GW_CHILD)\n        while child &gt; 0:\n            childRect = GetWindowRect(child)\n            for mon in mons:\n                if childRect == mon[2]:\n                    fullscreen = True\n                    break\n            if fullscreen:\n                break\n            child = GetWindow(child, GW_HWNDNEXT)\n    return fullscreen\n\neg.result = GetFullScreen()')
            </Action>
            <Action XML_Guid="{F7A8F38A-2F29-40CE-A898-E21F877D1B6E}">
                EventGhost.NewJumpIf(XmlIdLink(398), 1, False)
            </Action>
            <Action XML_Guid="{F5A63482-D692-411F-A40B-0D45CEE35F31}">
                Window.SendKeys(u'{Alt+Return}', False)
            </Action>
            <Action XML_Guid="{FA865804-497F-41FA-9510-F5658372EB5C}">
                EventGhost.Wait(0.3)
            </Action>
            <Action XML_Guid="{7516A6D6-D4DD-486D-AEB8-B819E176DF99}">
                Mouse.MoveAbsolute(105, 1835)
            </Action>
            <Action XML_Guid="{431F84BE-CC3B-4001-A1DE-FA982AB62260}">
                EventGhost.Wait(0.1)
            </Action>
            <Action XML_Guid="{79EBB3D3-04A6-440E-AA1A-C4E643C6C627}">
                Mouse.LeftButton()
            </Action>
            <Action XML_Guid="{7184FF9F-A4F1-4570-B281-7B1CCF27ACCB}">
                EventGhost.NewJumpIf(XmlIdLink(398), 0, False)
            </Action>
        </Macro>
    </Folder>
</EventGhost>
eventghost.net
Be there or be square.

Post Reply