AutoHotkey Community

It is currently May 27th, 2012, 10:31 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: active a specific window
PostPosted: October 15th, 2007, 2:19 am 
Offline

Joined: October 15th, 2007, 2:02 am
Posts: 9
Hi everyone, thanks for the help



I take this script http://www.autohotkey.com/forum/topic71 ... te+control ( very good)

But sometimes i loose the focus of my bsplayer ( video player)
I do not know to gain the focus again. I can use alt+tab, but i´m looking for something automatic, like

IfWinActive generic - bsplayer // i need to be generic because every time is a different movie
{
do noting
}
else
{
re-active bsplayer (like alt+tab find the bsplayer and re-open)
}

i want do this for configure one button of my remote control get the focus of the window of bsplayer ( video player) for my remote control back to work.
I know i always have just ONE bsplayer open.

thanks very much.

the other buttons i configure all with no problem.
I can use global keys on bsplayer, but i prefer this way because i do not want change the bsplayer, so it will work every computer with autohotkey :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 15th, 2007, 3:37 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Use Window Spy to find the window class of your media player. Window Spy can be launched by right-clicking the tray icon of an AutoHotkey script. Window Spy shows stats for the active window. For example, with Media Player Classic active, it says:
Quote:
>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Media Player Classic
ahk_class MediaPlayerClassicW
To activate MPC if it is not active, I'd use:
Code:
IfWinNotActive, ahk_class MediaPlayerClassicW
    WinActivate, ahk_class MediaPlayerClassicW
This would work regardless of what window title MPC has.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 15th, 2007, 10:18 am 
Offline

Joined: October 15th, 2007, 2:02 am
Posts: 9
thanks you very much, it is working :D

my code
Code:
^!c::
IfWinNotActive, ahk_class MediaPlayerClassicW
    WinActivate, ahk_class MediaPlayerClassicW
IfWinActive, ahk_class MediaPlayerClassicW
Send, {SPACE}
return


Because has no timer, with one ctrl+alt+c, i have re-open the window of MPC and play instant.

thanks again

[/quote]


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, chaosad, robotkoer, Yahoo [Bot] and 75 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