Kodi Community Forum
Win XBMCLauncher / Launcher4Kodi - All in One Tool for Change Shell, Set Focus and more - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: Win XBMCLauncher / Launcher4Kodi - All in One Tool for Change Shell, Set Focus and more (/showthread.php?tid=136798)



RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - baijuxavior - 2014-07-04

(2014-07-03, 09:51)Jkruger Wrote: Great program,

Is there a way to show a custom background (or even better turn the screen off) when I shut down xbmc into XBMCLauncher shell? As it is now I have the machine to sleep after x minutes when idle (for making sure no background tasks is running), it is only showing a black screen when XBMC have exit but you can still see that it is on.

(2014-07-03, 23:20)Jkruger Wrote: Thnks baijuxavior,

Now the obvious question if you are a nob like me, witch script file do I need to change? And is there a setting in the script that is easy to change or do I have to come up with something somewhere, I guess it involves compiling etc, have nooo idea what I am doing. Sorry,

If you select the option start explorer when xbmc is closed, it will display the desktop. This is the code you need to edit. Download the source code from the github link in the first page and open the file XBMCLauncher.ahk in notepad. To turn off the display, replace the lines from 1666 to 1675

Code:
Process, Exist, xbmc.exe ; check if xbmc.exe is running
            If (ErrorLevel = 0) ;if not running
                {    Process, Exist, explorer.exe ; check if explorer.exe is running
                    If (ErrorLevel = 0)
                        Run,  %A_WinDir%\Explorer.exe, %A_WinDir%
                        
                    Process, Exist, explorer.exe ; if explorer.exe is not started in previous step
                    If (ErrorLevel = 0)
                        Run Explorer.exe
                }


with


Code:
Process, Exist, xbmc.exe ; check if xbmc.exe is running
            If (ErrorLevel = 0) ;if not running
                {    Sleep 1000
                     SendMessage 0x112, 0xF170, 2,,Program Manager
                }

Save the file and rightclick and compile to get the exe file, assuming you have installed autohotkey. Replace the exe file in your program folders with the newly compiled one.


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - Jkruger - 2014-07-04

Thanks for your prompt reply, now I got it.

But it didn't work, due to that it didn't started Windows shell. When I start explorer.exe manually it will turn of the screen, i cut and pasted a bit and got him to start windows shell and blank the screen but then it will flicker on windows in between, annoying. Another problem I am going to run in to is that if I turn it of this way I can not restart XBMC until it goes to sleep.

As a background what I try to accomplish are that I want to have a server and xbmc as a client on the same machine, if someone turns xbmc off (on the power button or exit) I need to have the computer to wait until the background processes are finished (ex. nextpvr recording) until it goes to sleep. It would be the best just to turn the telly off, but my aim is to get it to look like it turns off if you exit or press the button. Next problem on the list is if I have a recording or another device turning the server on and the TV is still on it is going to look like it start up for no reason.

Hmm much problem for a small issue, I know, but if this could be sorted I would be forever grateful


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - baijuxavior - 2014-07-04

Why not start the desktop when xbmc exits? You can give a black wallpaper and hide all icons and taskbar and set the display to turn off after a few minutes.


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - Jkruger - 2014-07-04

Yea, you might be right.

Have to rethink the whole setup, the problem is that the server have to have priority and I want it to sleep when idle. What ever I do will cause one problem or another,

Is it possible with Autohotkey to script the power button? I need to write a scrip that checks if the recording service is started when trying to sleep the computer (either on button press or from XBMC), and if, just blank the screen to make it look like it turns off.

Anyway thanks for your help and a great program,


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - baijuxavior - 2014-07-04

Autohotkey can check for a process. Use the code snippet:

Code:
Process, Exist, processname.exe ; check if process.exe is running
If (ErrorLevel > 0) ; If it is running
        { your code
        }



RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - Jkruger - 2014-07-05

You are a star,

Could it be checked before system sleep, what ever is causing it even the power button?


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - baijuxavior - 2014-07-05

(2014-07-05, 01:08)Jkruger Wrote: You are a star,

Could it be checked before system sleep, what ever is causing it even the power button?

Yes. Code from line 414 to 461 does it. This is what you need:

Code:
OnMessage(0x218, "WM_POWERBROADCAST")

WM_POWERBROADCAST(wParam, lParam)

{
    If (wParam=4) ;suspend
    {        
        Process, Exist, xbmc.exe ; check if xbmc.exe is running
            If (ErrorLevel > 0) ; If it is running
            {
                ;your code
            }
        
    }    
}



RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - richardb70 - 2014-07-08

Hi,

I'm running emulators via Advanced Launcher, and they only seem to work if the .exe files are set up in the External Players section. However, I'm running out of slots! Is there a workaround? Do you have any plans to increase the capacity?

Many thanks in advance.


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - JOCrystals - 2014-07-10

(2014-07-08, 14:39)richardb70 Wrote: Hi,

I'm running emulators via Advanced Launcher, and they only seem to work if the .exe files are set up in the External Players section. However, I'm running out of slots! Is there a workaround? Do you have any plans to increase the capacity?

Many thanks in advance.

^^^THIS^^^^Cool I am also running into this any advice?!?!


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - baijuxavior - 2014-07-10

(2014-07-08, 14:39)richardb70 Wrote: Hi,

I'm running emulators via Advanced Launcher, and they only seem to work if the .exe files are set up in the External Players section. However, I'm running out of slots! Is there a workaround? Do you have any plans to increase the capacity?

Many thanks in advance.

(2014-07-10, 05:16)JOCrystals Wrote:
(2014-07-08, 14:39)richardb70 Wrote: Hi,

I'm running emulators via Advanced Launcher, and they only seem to work if the .exe files are set up in the External Players section. However, I'm running out of slots! Is there a workaround? Do you have any plans to increase the capacity?

Many thanks in advance.

^^^THIS^^^^Cool I am also running into this any advice?!?!

This needs modification in the code. I can post the necessary code here if you are interested. You will need to compile the exe yourself (which is very easy).


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - JOCrystals - 2014-07-10

(2014-07-10, 10:24)baijuxavior Wrote:
(2014-07-08, 14:39)richardb70 Wrote: Hi,

I'm running emulators via Advanced Launcher, and they only seem to work if the .exe files are set up in the External Players section. However, I'm running out of slots! Is there a workaround? Do you have any plans to increase the capacity?

Many thanks in advance.

(2014-07-10, 05:16)JOCrystals Wrote:
(2014-07-08, 14:39)richardb70 Wrote: Hi,

I'm running emulators via Advanced Launcher, and they only seem to work if the .exe files are set up in the External Players section. However, I'm running out of slots! Is there a workaround? Do you have any plans to increase the capacity?

Many thanks in advance.

^^^THIS^^^^Cool I am also running into this any advice?!?!

This needs modification in the code. I can post the necessary code here if you are interested. You will need to compile the exe yourself (which is very easy).

That would be grand...... I'm not that experienced with code but I'm almost positive i can figure it out!


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - baijuxavior - 2014-07-11

(2014-07-10, 18:48)JOCrystals Wrote:
(2014-07-10, 10:24)baijuxavior Wrote:
(2014-07-08, 14:39)richardb70 Wrote: Hi,

I'm running emulators via Advanced Launcher, and they only seem to work if the .exe files are set up in the External Players section. However, I'm running out of slots! Is there a workaround? Do you have any plans to increase the capacity?

Many thanks in advance.

(2014-07-10, 05:16)JOCrystals Wrote: ^^^THIS^^^^Cool I am also running into this any advice?!?!

This needs modification in the code. I can post the necessary code here if you are interested. You will need to compile the exe yourself (which is very easy).


That would be grand...... I'm not that experienced with code but I'm almost positive i can figure it out!


Install autohotkey. Download the XBMCLauncher.ahk file from the source code link given in the first page. Open it in notepad and modify the line at 1153 as follows:

Code:
DisableFocusOnExternalPlayer()
{
    global appsname
    ExternalPlayerRunning = 0
    
    Process, exist, process1
    If (ErrorLevel > 0)
        ExternalPlayerRunning = 1
        
    Process, exist, process2
    If (ErrorLevel > 0)
        ExternalPlayerRunning = 1

Add as many process names you want, save the file and right click to compile. Replace the original exe file in programs folder.


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - JOCrystals - 2014-07-11

(2014-07-11, 08:30)baijuxavior Wrote:
(2014-07-10, 18:48)JOCrystals Wrote:
(2014-07-10, 10:24)baijuxavior Wrote: This needs modification in the code. I can post the necessary code here if you are interested. You will need to compile the exe yourself (which is very easy).


That would be grand...... I'm not that experienced with code but I'm almost positive i can figure it out!


Install autohotkey. Download the XBMCLauncher.ahk file from the source code link given in the first page. Open it in notepad and modify the line at 1153 as follows:

Code:
DisableFocusOnExternalPlayer()
{
    global appsname
    ExternalPlayerRunning = 0
    
    Process, exist, process1
    If (ErrorLevel > 0)
        ExternalPlayerRunning = 1
        
    Process, exist, process2
    If (ErrorLevel > 0)
        ExternalPlayerRunning = 1

Add as many process names you want, save the file and right click to compile. Replace the original exe file in programs folder.

Beast!!! Thank you so much!!Big GrinBig GrinBig Grin


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - richardb70 - 2014-07-16

Ditto!


RE: XBMCLauncher - All in One Tool for Change Shell, Set Focus and more - CrashOver1D - 2014-07-17

Hi, new around, first post :-)

I'm curently moving from a Netgear NeoTV to a real HTPC for my multimedia needs on main TV
Done a fresh install of Windows 8.1 on an Intel NUC D54250WYK, all drivers install and all updates ok
Install XBMC, set some params (MySQL database on a Synology NAS and some language params), all running perfect like on my main PC used to create all the databases before I received the NUC

Now I'm start for the real "HTPC" part and install XBMCLauncher, but I have a problem with the "Open Metro UI on XBMC exit" option.
I've tried both scenarios with Shell explorer / XBMC :

1) Shell Explorer
Work as wanted, if I closed XBMC, desktop pop and shortly Metro UI appears, good but with explorer as Shell, I can see desktop at startup, I try to avoid this ^^
--> So, try the second option

2) Shell XBMC
I've got a first problem, XBMC somtimes start without my profile, as a fresh new XBMC (without databases)
It seems I solved this issue by adding the timer before XBMC start (at 10s)
But now I can't manage to go back to Metro UI when I close XBMC, I'm always back to desktop ... even if I unckeck the option for starting explorer at XMBC close !?!

I don't really understand why it's happening, and even how it's possible ?
Any ideas ?