Keeping XBMC on top in Windows 7 Home Premium x64
#31
The issue I have is that I run both XBMC and WMC (for Live TV).

I let XBMC run in the background while WMC is up. When I exit out of WMC however, XBMC is always running but not focused (task bar is on top of it). I need to get up and manually click the window to make it active.

I need to review the scripts in this thread to see if I can make it set XBMC to the top when its switched to.
Reply
#32
(2012-07-09, 17:32)Quick2822 Wrote: The issue I have is that I run both XBMC and WMC (for Live TV).

I let XBMC run in the background while WMC is up. When I exit out of WMC however, XBMC is always running but not focused (task bar is on top of it). I need to get up and manually click the window to make it active.

I need to review the scripts in this thread to see if I can make it set XBMC to the top when its switched to.
I use both XBMC and 7MCE, and here is what I did- post #751......

>Alienware X51- do it all HTPC
>Simplify XBMC configurations
>HOW-TO Bitstreaming using XBMC
I refused to watch movie without bitstreaming HD audio!
Reply
#33
This focus stealing problem in Window 7 is really annoying and it seams it can not be disabled in OS like in Windows XP. Well done MS! Big Grin

In order to overcome this problem I picked up baijuxaviors Autoscript cause the Focusbitch idea has some flaws for me:
One point is in the first 30 seconds it is impossible to start external programs cause Focusbitch won't let you. After that period my VPN connection still bothers me when breaking down. And a neverending Focusbitch is no solution cause it makes external programs like games impossible. But I like to start them inside XBMC so I extended the script to fit my needs. Perhaps it is usefull for some other folks out there. It works with a windowed OR a fullscreen XBMC!! Fullscreeen should be preferred.

The idea is to start XBMC with an compiled Autoscript executable and maintain its focus all the time - so no visible desktop anymore.
But when an external program like a game is started the script has to stop giving XBMC the focus and should keep on working after the game ended. To do so I choose an old DOS method called flag files. So when a defined file (xbmc_external) do exit in a certain path the script will stop giving XBMC the focus. After this flag file is deleted it goes back to XBMC automatically.
So everything we need besides the Autoscript program is a start batch file that creates the flag file when starting the game and deletes it after work is done. I use XMBC advanced launcher to start this batch file that is given the external program I want to start as a parameter.

So first of all download AutoHotkey and install it on your computer: Homepage AutoHotkey

Then cut&paste this script file and save it as XBMC.ahk:
---------------------- ziiiippp ----------------------
#NoEnv
#SingleInstance ignore
SendMode Input
SetWorkingDir %A_ScriptDir%
; #!Enter:: ; Add a hotkey to start xbmc using Ctrl+Alt+Enter. Useful for the mce green button.

; Path and Flag Files
XBMCPath = c:\Program Files (x86)\XBMC
ScriptPath = C:\Script
Flag = xbmc_external

run %XBMCPath%\XBMC.exe

loop
{
Process, Exist, xbmc.exe
If (ErrorLevel = 0)
{
return
}

WinActivate, ahk_class XBMC
WinWaitActive, ahk_class XBMC
sleep 400

loop
{
IfExist, %ScriptPath%\%Flag%
{
sleep 1000
Process, Exist, xbmc.exe
If (ErrorLevel = 0)
{
return
}
}
else
{
break
}
}

}
return
---------------------- ziiiippp ----------------------

Check the path information in the header to fit your needs and save it to your harddisk. Right click this saved file and you should see the "compile script" in the menu. This generates an executable for you that will start XMBC and maintain its focus. Put it in your autostart folder and see if it works. When exiting XBMC this script will terminate, too. So use the compiled script to start your XBMC all the time.

Default Path for XBMC installation here is c:\Program Files (x86)\XBMC\
And default path for the batch file and flag folder is: C:\Script\

Now we need a proper batch file for starting our external programs:
---------------------- ziiiippp ----------------------
@echo off
set ScriptPath=C:\script
cd %ScriptPath%
echo . > xbmc_external
cd "%~p1"
call "%~n1"
cd %ScriptPath%
del xbmc_external

---------------------- ziiiippp ----------------------

Modify the second line to your needs and save it as START_EXTERNAL.BAT in your script folder (e.g. C:\Script\)
This batch will care for the flag file and call your external program. It will wait until it terminates and delete the flag file so XBMC will show up again.

Now we are able to configure our first external program in advanced lancher!
Since a batch file needs a command shell to work the program to start in advanced lancher is not the batch itself but the windows command shell executable. You find this one in your Windows / System32 folder. (eg. c:.\windows\system32\cmd.exe)

Select this shell as the program to execute in advanced lancher and after this we start editing the important start parameters.

In case your Script directory is C:\script\ use the following parameter to start your game.exe in the c:\games_folder\ path (example):

/c c:\script\start_external.bat "c:\games_folder\game.exe"

You see the first parameter is "/c" and tells cmd.exe to carry out the command specified by the following string and then terminate.
The second parameter is the saved start batch file and the third parameter is your extermal program with its full path.

Try and have fun!

Mike
Reply
#34
I had some problems with focus on Windows 8.
This little tool:
Windows XBMC Launcher - All in One Tool for Change Shell, Autostart XBMC, Set Focus and more
solved all my problems. I´m guessing it works on Win7 just as well.
Reply
#35
I'm happy to know that my xbmclauncher works on Windows 8. You could try my new version 2.0 with added features.
Reply
#36
Is it so difficult to insert code in XBMC to stay on front in screen mode ?! It's a stupid problem but a real problem at every resume.
Reply
#37
I prefer to use Always On Top Maker, although I like FocusBitch too Smile

Advantages:
Toggle Always On Top is possible
It keeps it really on top instead of giving away focus for a second and returning focus (you can see it switch)

Disadvantages:
The CTRL-ALT-T and CTL-ALT-Q button combinations (hardcoded) are a bit hard to quickly press and may also activates other keyboard assignments in XBMC

Download here:
http://www.fadsoft.net/AlwaysOnTopMaker.htm

Regards,

Nika.
Reply
#38
I think its very hard to fix something they dose not admit is broken.
Reply
#39
I'm curious if it's possible to have windowed XBMC Win32 maintain aspect ratio when I scale the window. As it stands you scale hort vert separately. MPC allows you to set "Limit windows proportions on resize" and when you drag the window size it maintains the video's aspect ratio. Is there such a setting I can make in advancedsettings.xml etc so this is the behavior on window resize ?
Reply
#40
(2013-04-09, 01:59)HiroPro Wrote: I'm curious if it's possible to have windowed XBMC Win32 maintain aspect ratio when I scale the window. As it stands you scale hort vert separately. MPC allows you to set "Limit windows proportions on resize" and when you drag the window size it maintains the video's aspect ratio. Is there such a setting I can make in advancedsettings.xml etc so this is the behavior on window resize ?


Zero reply...

huh
Reply
#41
Wink 
HAHAHAHA i cant stop laughing, the name is so right it's not even funny IT's HILARIOUS!!!

spank you very much for this! ...should be built in to XBMC IMHO Smile
The Problem is not the problem. The problem is your attitude about the problem.
Do you understand?
Reply

Logout Mark Read Team Forum Stats Members Help
Keeping XBMC on top in Windows 7 Home Premium x640