Code: Select all
SysGet, n, monitorcount
Loop, % n
{
SysGet, M, Monitor, %A_Index%
MX%A_index% := Mleft
MY%A_index% := MTop
MW%A_index% := MRight - MLeft
MH%A_index% := MBottom - MTop
Global X_ := Mleft
Global Y_ := MTop
Global W_ := MRight - MLeft
Global H_ := MBottom - MTop
}
Gui, Vid:New, +alwaysontop -Caption +owndialogs +HwndVNP -dpiscale, Video Now Playing ;+E0x02000000 +E0x00080000
Gui, color, black
Gui, Add, ActiveX, x0 y0 w%W_% h%H_% vWMP, WMPLayer.OCX
WMP.uiMode := "none" ; no WMP controls
WMP.stretchToFit := 1 ; video is stretched to the given activex range
WMP.enableContextMenu := 0 ; no reaction to right click in the video field
Gui, Show, x%X_% y%Y_% hide, Video Now Playing ;initially hidden to avoid black screen before the video starts
Clip := WMP.newMedia(Now) ; create a new Media object, now = path to chosen video
Dur:= Clip.getItemInfo("Duration") ; get its duration
WMP.currentMedia := Clip ; set the players 'currentMedia' object
WMP.controls.play ; play
sleep 1000
Gui, Vid:show,noactivate x%X_% y%Y_% h%H_% w%W_% ;coordinates of second monitor