AutoHotkey Community

It is currently May 26th, 2012, 11:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: November 17th, 2009, 1:47 am 
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!

[]


Report this post
Top
  
Reply with quote  
PostPosted: November 17th, 2009, 2:35 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2009, 2:59 am 
Offline

Joined: November 17th, 2009, 1:49 am
Posts: 25
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 12:31 am 
Offline

Joined: October 9th, 2006, 8:19 pm
Posts: 236
Location: Finland
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 January 7th, 2010, 4:59 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 1:01 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 5:50 am 
Offline

Joined: November 17th, 2009, 1:49 am
Posts: 25
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!:D


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Leef_me, Maestr0, Pulover, rbrtryn, XstatyK and 56 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group