With the modified exe on this thread I'm experiencing tearing issues (I've to disable Directx Exclusive mode ) so using the original exe I've tried your script
and now it works well and I can activate Directx Exclusive mode too no more tearing!!!
I've created an .exe file and I'm calling it whit my Imon remote as I do whit the original MP.exe to start Mediaportal but the put focus function that Mp has if already running don't work well (... it works but it switch uselessly the screen too...)
So I've changed it to avoid this:
Code:
#NoTrayIcon
; It only puts the focus on and maximize it if was minimized if Mediaportal is already running.
If (WinExists ("MediaPortal") ) Then
WinActivate ("MediaPortal")
Exit
EndIf
$MP_Path = "C:\Program Files\Team MediaPortal\MediaPortal"
RunWait ("RunDll32.exe NvCpl.dll,dtcfg Primary 2")
$MP_PID = Run ($MP_Path & "\MediaPortal.exe", $MP_Path)
WinWait ("MediaPortal - Home")
$ret = WinSetState ("MediaPortal - Home", "", @SW_MAXIMIZE)
RunWait ("RunDll32.exe NvCpl.dll,dtcfg Primary 1")
ProcessSetPriority ($MP_PID, 4)
It maximize MP if is accidentally minimized, too
This AutoIt is really useful... so many interesting functions!!!
fanoI