AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WMedia Player: FullScreen (toggle) with video stopped-HELP!

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
blehmeco
Guest





PostPosted: Tue Nov 17, 2009 12:47 am    Post subject: WMedia Player: FullScreen (toggle) with video stopped-HELP! Reply with quote

Hey there guys!

So, i was trying to get a script to do this: after adding a file 2 play on Windows Media Player (11), press "CTRL+<" to put it in Full screen mode, wait a few miliseconds 4 the fullscreen mode 2 b ok and then play the video; by pressing "CTRL+<" again when playin it (or when the video ends) return to normal mode (i.e. not Full screen) and pause the video.

I've come up with this possible (and a bit ugly) workaround:

Code:
GroupAdd, WindowsMediaPlayer, ahk_class WMPlayerApp
GroupAdd, WindowsMediaPlayer, ahk_class WMPTransition

#IfWinActive, ahk_group WindowsMediaPlayer

^<::
   SendInput, {Media_Play_Pause}{Media_Play_Pause}
   SendInput, {Alt Down}{Enter}{Alt Up}
   Sleep, 850
   SendInput, {Media_Play_Pause}
Return



This works, however...
As you must have noticed, I had to play&pause the video b4 full screening it in the code, cuz otherwise if the video was stopped, WMPlayer won't go into fullscreen mode!
And nothing works! Not even WMPlayer's own shortcuts!
So i came across the following SendMessages:

SendMessage 0x111,18782,0,,ahk_class WMPlayerApp
and
SendMessage 0x111,32782,0,,ahk_class WMPlayerApp

(found here: http://www.autohotkey.com/forum/topic8566.html&highlight=full+screen+media+player)

which would be a much cleaner way of putting the video on full screen b4 playing it, not loosing a bit of it and also avoiding the use of WMPlayer own "Alt+Enter" shortcut, however these only seem to work when the player is playing/paused (just like every other default WMPlayer shorcut anyway.."Alt+Enter" included) and not when it's stopped..
Also, the above mentioned SendMessage "Full screen togglers" dont seem 2 work in Full screen mode, not getting the video back 2 normal mode when in Full screen mode (they dont act as togglers at all..)


So, my question is:
Does any1 know of way of putting a video 2 full screen and back 2 normal in WMPlayer, when the video is stopped?

Thanks in advance!

Cheers!

[]
Back to top
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Tue Nov 17, 2009 1:35 am    Post subject: Re: WMedia Player: FullScreen (toggle) with video stopped-HE Reply with quote

blehmeco wrote:
And nothing works! Not even WMPlayer's own shortcuts!
WMP does not support this feature. Check the View menu when media is stopped: Full Screen is not available. I believe Media Player Classic has this capability.

blehmeco wrote:
...the above mentioned SendMessage "Full screen togglers" dont seem 2 work in Full screen mode
Full Screen mode has a different ahk_class, as noted in your first code example.
Back to top
View user's profile Send private message Visit poster's website
blehmeco



Joined: 17 Nov 2009
Posts: 25

PostPosted: Tue Nov 17, 2009 1:59 am    Post subject: Reply with quote

Thanks a lot 4 your quick reply jaco!

So, if WMPlayer does not support this feature, there is no way i'm gonna b able 2 fullscreen a video without playing it first,right?...damn!that sucks!..guess my workaround is the only solution 2 this in WMP...



Quote:
Full Screen mode has a different ahk_class, as noted in your first code example.


and you don't happen 2 know how i can use that kind of togglers (or something similar) in Full screen mode 2 go back to normal mode without using "Alt+Enter" (default windows stuff), do you?

cheers mate!
Back to top
View user's profile Send private message
svi



Joined: 09 Oct 2006
Posts: 236
Location: Finland

PostPosted: Wed Nov 18, 2009 11:31 pm    Post subject: Reply with quote

This will "start" WMP in Fullscreen (slightly tested):
Code:
file = (video file path)

DetectHiddenWindows On

DllCall("Shell32\ShellExecuteA", "UInt", 0, "UInt", 0
        , "Str", file
        , "Str", ""
        , "UInt", 0, "Int", 0x6) ; SW_MINIMIZE := 0x6
WinWait ahk_class WMPlayerApp
Sleep 1000
SendMessage 0x111, 18782 , 0, , ahk_class WMPlayerApp ; FULLSCREEN
WinWait ahk_class WMPTransition
WinShow ahk_class WMPTransition
WinWaitClose ahk_class WMPTransition
WinShow ahk_class WMPlayerApp

_________________
Pekka Vartto


Last edited by svi on Thu Jan 07, 2010 3:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Thu Nov 19, 2009 12:01 am    Post subject: Reply with quote

That will start WMP normally, and then (almost immediately) switch to full screen. For me, it is the same as using the command line option.
Code:
file = ;(video file path)
Run, %A_ProgramFiles%\Windows Media Player\wmplayer.exe "%file%" /fullscreen


Command Line Parameters for WMP
Quote:
Play the specified file in full-screen mode.
You must specify the path and file name of the content to play.

Note that it requires a file name. You cannot simply start the player in full screen. The following does not work.
Code:
Run, %A_ProgramFiles%\Windows Media Player\wmplayer.exe /fullscreen
Back to top
View user's profile Send private message Visit poster's website
blehmeco



Joined: 17 Nov 2009
Posts: 25

PostPosted: Thu Nov 19, 2009 4:50 am    Post subject: Reply with quote

Thanks 4 your replies!

1st of all that's fantastic jaco! didn't know of that command line parameter...
my workaround is still the best 2 do what i wanted @ first, but now that i found out i can play a file directly in fullscreen without loosing much of the video itself (the fullscreen mode loads rather quickly indeed!), i think i'll use your solution!

so here's my code 2 play a video file in WMPlayer directly in fullscreen after selecting it in Explorer or such...:

Quote:

^<::
WinGetClass, ClassOfOpenWindow, A
If ClassOfOpenWindow in ExploreWClass,CabinetWClass,Progman

{
Clipboard =
SendInput, ^c
ClipWait, 1
RegExMatch(Clipboard, "\.[a-zA-Z]+$", ExtensionOfFile)
StringLower, ExtensionOfFile, ExtensionOfFile
ExtensionOfFile := SubStr(ExtensionOfFile, 2)
If ExtensionOfFile in avi,mpg,flv,mov,qt,mkv
{
Run, %A_ProgramFiles%\Windows Media Player\wmplayer.exe "%Clipboard%" /fullscreen
Clipboard := ClipSaved
}Else
Clipboard := ClipSaved
SendInput, % SubStr(A_ThisHotkey, 2)
}Else
SendInput, % SubStr(A_ThisHotkey, 2)
Return


it does what it's supposed 2 do, so that's pretty much ok!

thanks a lot 4 your helpful posts!

Cheers!Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group