home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Installation, configuration support
MCE Remote and its green button...
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="trailboy" data-source="post: 37004" data-attributes="member: 18081"><p>That's correct. If for any reason MP looses the focus, AutoFocusOnMP.exe will put the focus back on MP.</p><p></p><p>That's correct again. AutoFocusOnMP.exe is only useful if you are running MP and you do not intend to do anything else apart from that while MP is running. I mean that this script will not allow you to run MP in a window while surfing the web or writing a text with your favorite text editor at the same time. AutoFocusOnMP.exe will always keep the focus on MP either in fullscreen and windowed mode.</p><p></p><p>I did this script because I wanted to be able to start MP with my MCE remote (green button) and never loose the focus on MP. I hate walking to my PC when I am already sitting on the sofa just to click anywhere in the screen in order to set the focus on MP when runnig fullscreen... </p><p></p><p>I first installed mptray (as cheezey told me to do) and then since I started experiencing problems with MP losing the focus I wrote this script. It allows me to run MP from the remote, close it, run it again, close it... And I never loose the focus on it! I do not have to move any more from the sofa!!!</p><p></p><p></p><p>What you are asking for is not difficult, but if I make the script to exit after giving the focus to MP you may have the same problem if you reopen MP without executing the script first... </p><p></p><p>I have a better idea. Let's make the script stay alive like the previous one but let's only allow it to give the focus back to MP once (5seconds after MP starts).</p><p></p><p>The following script will wait until you open MP and after 5 seconds it will force MP to get the focus. The script will then wait until MP is shut down to carry on with its execution. If MP is reopened, the script will then start again from scratch. Doing this, MP is forced to get the focus on startup after 5 seconds and will allow you to manually set the focus onto something else... I think that is what you want... But if for any reason MP looses the focus again without any user interaction after those 5 seconds, MP will not get the focus back until you restart it or set manually the focus on it!</p><p>[code]</p><p>;-----------</p><p>;this small script waits for MP to start and after 5 seconds it will force the focus onto it</p><p>;the focus can be manually set to something else after those 5 seconds</p><p>;-----------</p><p></p><p>;variable needed for the infinite loop</p><p>$i = 0</p><p></p><p>;start infinite loop, it will never finish...</p><p>;you can manually exit the script from the tray</p><p>Do</p><p></p><p> ;this will make the script to wait for Media Portal window to be opened</p><p> ;the script will wait here until Media Portal is started</p><p> WinWait("Media Portal - ")</p><p></p><p> ;wait for 5 seconds </p><p> Sleep(5000)</p><p></p><p> ;if we get here it's because the Media Portal window has been opened 5 seconds ago</p><p> ;this will activate (give focus) to Media Portal window</p><p> WinActivate("Media Portal - ", "")</p><p></p><p> ;this will make the script to sleep until Media Portal is closed </p><p> ;when Media Portal is closed, the script will wake up and carry on looping</p><p> ProcessWaitClose("MediaPortal.exe")</p><p></p><p>;this condition will never happen and will keep the script alive</p><p>;everything starts over again and from the beginning of the loop</p><p>Until $i = 1</p><p></p><p>;----------- </p><p>[/code]</p><p></p><p>Grab ForceFocusOnMPAfter5Sec.exe from here <a href="http://www.lorenyleti.info/test/ForceFocusOnMPAfter5Sec.exe" target="_blank">http://www.lorenyleti.info/test/ForceFocusOnMPAfter5Sec.exe</a></p><p></p><p>I have the feeling that this would work work as well in a dual display setup, but I cannot test it. By the way, I am at work and I cannot test this just created ForceFocusOnMPAfter5Sec.exe with MP but have done my tests with other windows and it works fine.</p><p></p><p>Load this on windows startup like AutoFocusOnMP.exe! </p><p></p><p>Remember both scripts do similar things but in different ways, choose yours!</p><p></p><p>Small and easy scripts that give me a lot of satisfaction... I like a lot MP and would like to contribute in any way I can... If this can be considered as a contribution I will be then be very pleased to help you all in anything I can.</p><p></p><p>Suggestions, questions and comments welcome.</p><p></p><p>See you soon!</p></blockquote><p></p>
[QUOTE="trailboy, post: 37004, member: 18081"] That's correct. If for any reason MP looses the focus, AutoFocusOnMP.exe will put the focus back on MP. That's correct again. AutoFocusOnMP.exe is only useful if you are running MP and you do not intend to do anything else apart from that while MP is running. I mean that this script will not allow you to run MP in a window while surfing the web or writing a text with your favorite text editor at the same time. AutoFocusOnMP.exe will always keep the focus on MP either in fullscreen and windowed mode. I did this script because I wanted to be able to start MP with my MCE remote (green button) and never loose the focus on MP. I hate walking to my PC when I am already sitting on the sofa just to click anywhere in the screen in order to set the focus on MP when runnig fullscreen... I first installed mptray (as cheezey told me to do) and then since I started experiencing problems with MP losing the focus I wrote this script. It allows me to run MP from the remote, close it, run it again, close it... And I never loose the focus on it! I do not have to move any more from the sofa!!! What you are asking for is not difficult, but if I make the script to exit after giving the focus to MP you may have the same problem if you reopen MP without executing the script first... I have a better idea. Let's make the script stay alive like the previous one but let's only allow it to give the focus back to MP once (5seconds after MP starts). The following script will wait until you open MP and after 5 seconds it will force MP to get the focus. The script will then wait until MP is shut down to carry on with its execution. If MP is reopened, the script will then start again from scratch. Doing this, MP is forced to get the focus on startup after 5 seconds and will allow you to manually set the focus onto something else... I think that is what you want... But if for any reason MP looses the focus again without any user interaction after those 5 seconds, MP will not get the focus back until you restart it or set manually the focus on it! [code] ;----------- ;this small script waits for MP to start and after 5 seconds it will force the focus onto it ;the focus can be manually set to something else after those 5 seconds ;----------- ;variable needed for the infinite loop $i = 0 ;start infinite loop, it will never finish... ;you can manually exit the script from the tray Do ;this will make the script to wait for Media Portal window to be opened ;the script will wait here until Media Portal is started WinWait("Media Portal - ") ;wait for 5 seconds Sleep(5000) ;if we get here it's because the Media Portal window has been opened 5 seconds ago ;this will activate (give focus) to Media Portal window WinActivate("Media Portal - ", "") ;this will make the script to sleep until Media Portal is closed ;when Media Portal is closed, the script will wake up and carry on looping ProcessWaitClose("MediaPortal.exe") ;this condition will never happen and will keep the script alive ;everything starts over again and from the beginning of the loop Until $i = 1 ;----------- [/code] Grab ForceFocusOnMPAfter5Sec.exe from here [url]http://www.lorenyleti.info/test/ForceFocusOnMPAfter5Sec.exe[/url] I have the feeling that this would work work as well in a dual display setup, but I cannot test it. By the way, I am at work and I cannot test this just created ForceFocusOnMPAfter5Sec.exe with MP but have done my tests with other windows and it works fine. Load this on windows startup like AutoFocusOnMP.exe! Remember both scripts do similar things but in different ways, choose yours! Small and easy scripts that give me a lot of satisfaction... I like a lot MP and would like to contribute in any way I can... If this can be considered as a contribution I will be then be very pleased to help you all in anything I can. Suggestions, questions and comments welcome. See you soon! [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Installation, configuration support
MCE Remote and its green button...
Contact us
RSS
Top
Bottom