Here is an updated script that supports Arcsoft's TMT as well as PowerDVD.....I've changed to TMT as PowerDVD has dropped HD-DVD support in V8.
; ========================================================
; JR Media Center 12 TheaterView Integration Script for PowerDVD or Total Media Theatre BluRay / HD-DVD playback
; --------------------------------------------------------
; The following script will detect if PowerDVD / Total Media Theatre starts up
; --------------------------------------------------------
#NoTrayIcon
#Persistent
#SingleInstance, Force
TargetWindow1 = CyberLink PowerDVD 8.0 ;- you can change to suit your requirments
TargetWindow = ArcSoft TotalMedia Theatre ;- you can change to suit your requirments
Gui,+LastFound
hWnd := WinExist()
DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessages" )
return
ShellMessages( wParam,lParam )
{
;Local k
global
If (wParam = 1)
{
NewID := lParam
WinGetTitle, Title, ahk_id %NewID%
WinGetClass, Class, ahk_id %NewID%
If Title =
{
sleep 2000
WinGetTitle, Title, ahk_id %NewID%
WinGetClass, Class, ahk_id %NewID%
}
If Title = %TargetWindow%
gosub ActionLabel
If Title = %TargetWindow1%
gosub ActionLabel
return 1
}
}
; --------------------------------------------------------
; The following script will run when PowerDVD or Arcsoft TMT Starts up and then will close MC12, Set Freq to 24hz and "Hides" the mouse
; --------------------------------------------------------
ActionLabel:
cD = 32 ; bits (quality) - you can change to suit your requirments
sW = 1920 ; pixels - you can change to suit your requirments
sH = 1080 ; pixels - you can change to suit your requirments
rR = 60 ; Hz (frequency) - you can change to suit your requirments
ChangeDisplaySettings( cD, sW, sH, rR )
Run MC12.exe /close
Mousemove 4000,0
return
; --------------------------------------------------------
; The following script will (if PowerDVD is running) Close PowerDVD, Set Freq back to 50hz, Run MC12 when the MCE "Stop" button is pressed
; --------------------------------------------------------
#IfWinExist CyberLink PowerDVD
Media_Stop:: ; This is the STOP button (Media_Stop) - you can change to suit your requirments
WinClose
Run C:\Program Files\J River\Media Center 12\Media Center 12.exe
cD = 32 ; bits (quality) - you can change to suit your requirments
sW = 1920 ; pixels - you can change to suit your requirments
sH = 1080 ; pixels - you can change to suit your requirments
rR = 50 ; Hz (frequency) - you can change to suit your requirments
ChangeDisplaySettings( cD, sW, sH, rR )
return
; --------------------------------------------------------
; The following script will (if Arcsoft TMT is running) Close TMT, Set Freq back to 50hz, Run MC12 when the MCE "Stop" button is pressed
; --------------------------------------------------------
#IfWinExist ArcSoft TotalMedia Theatre
Media_Stop:: ; This is the STOP button (Media_Stop) - you can change to suit your requirments
Run C:\Program Files\J River\Media Center 12\Media Center 12.exe
cD = 32 ; bits (quality) - you can change to suit your requirments
sW = 1920 ; pixels - you can change to suit your requirments
sH = 1080 ; pixels - you can change to suit your requirments
rR = 50 ; Hz (frequency) - you can change to suit your requirments
ChangeDisplaySettings( cD, sW, sH, rR )
Process, Close, uDigital Theatre.exe ; Needs to close the process as WinClose just minimises TMT
return
; --------------------------------------------------------
; The script that makes the DLL Call to change the resolution - Don't Change
; --------------------------------------------------------
ChangeDisplaySettings( cD, sW, sH, rR ) {
VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36)
DllCall( "EnumDisplaySettings", UInt,0, UInt,-1, UInt,&dM ), NumPut(0x5c0000,dM,40)
NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
Return DllCall( "ChangeDisplaySettings", UInt,&dM, UInt,0 )
}
; --------------------------------------------------------
; Credit to shimanov and Skan for the ChangeDisplaySetting script - see http://www.autohotkey.com/forum/viewtopic.php?t=8355
; Credit to Conquer for the script to monitor for PowerDVD's startup - see http://www.autohotkey.com/forum/viewtopic.php?t=26429
; --------------------------------------------------------