Kodi Community Forum

Full Version: XBMCLauncher / Launcher4Kodi - All in One Tool for Change Shell, Set Focus and more
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Yes, it will work. The code will be:

Code:
1::
Shutdown 2 ; 2 for restart
(2012-10-11, 17:59)baijuxavior Wrote: [ -> ]Yes, it will work. The code will be:

Code:
1::
Shutdown 2 ; 2 for restart

Where should I put this code?
Put the code at the bottom of the script.
What script?
could you be more specific?
XBMCLauncher.ahk file which you can download from the source code. Please read first page of this thread.
If anyone is interested:
I've added a feature to support DVBViewer as other/second player. Furthermore, can be adjusted to get the focus back XBMC even if the DVBViewer is only minimized.

Here the extra lines:

Code:
global DVBViewerPath := GetSettings("DVBViewer_Path", ProgFiles . "\DVBViewer\dvbviewer.exe")
global DVBViewerRunning = 0
global DVBViewerGetStatus := GetSettings("DVBViewerGetStatus", 0)
global DVBViewerSize = 0
global DVBViewerActive = 0

Menu, Tray, add, Set DVBViewer Path (for focus disable), MenuSetDVBViewerHandler
Menu, Tray, add, Ignore if DVBViewer is minimized, MenuCheckDVBViewerGetStatusHandler
Menu, Tray, UnCheck, Ignore if DVBViewer is minimized
Menu, Tray, add


if (DVBViewerGetStatus = 1)
    Menu, Tray, Check, Ignore if DVBViewer is minimized


SetTimer, MonitorEvents, 500

MonitorEvents:
KeepFocus()
CheckDVBViewerRunning()
GetDVBViewerSize()
StartExplorer()
MonitorCustomShutdown()
DisableFocusOnExternalPlayer()
DisableFocusOnDVBViewer()
return


MenuSetDVBViewerHandler:
DVBViewerPath := SaveApplicationPath("DVBViewer", DVBViewerPath)
return

MenuCheckDVBViewerGetStatusHandler:
CheckDVBViewerGetStatus()
return


KeepFocus()
{
    if (FocusDelay = 0 or DisableFocusTemporarily = 1 or ExternalPlayerRunning = 1 or DVBViewerActive = 1)   ; <----------- add "DVBViewerActive = 1"


; >>>>>>>>>>>>         DVBViewer FUNCTIONS        <<<<<<<<<<<<<<<<<<<<<<<<<


CheckDVBViewerGetStatus()
{
    menu, tray, ToggleCheck, Ignore if DVBViewer is minimized    
    if (DVBViewerGetStatus = 0)
        DVBViewerGetStatus = 1 ;enable. check DVBViewer window size
    else
        DVBViewerGetStatus = 0 ;disable. dont check DVBViewer window size
        
        IniWrite, %DVBViewerGetStatus%, %SettingsPath%, Settings, DVBViewerGetStatus
        return
}



GetDVBViewerSize()
{
    WinGet, DVBViewerPresentSize, MinMax, ahk_class TfrmMain
    if DVBViewerPresentSize < 0
        DVBViewerSize = 0
    if DVBViewerPresentSize = 0
        DVBViewerSize = 1
    if DVBViewerPresentSize = 1
        DVBViewerSize = 2
}



CheckDVBViewerRunning()
{
    SplitPath, DVBViewerPath, viewername
    Process, exist, %viewername%    
    If (ErrorLevel >= 1)
        DVBViewerRunning = 1
    Else
        DVBViewerRunning = 0
}



DisableFocusOnDVBViewer()
{
    IF (DVBViewerRunning = 1 and DVBViewerGetStatus = 0)
        DVBViewerActive = 1
    Else If (DVBViewerRunning = 1 and DVBViewerGetStatus = 1)
        {
        If (DVBViewerSize > 0)
            DVBViewerActive = 1
        Else
            DVBViewerActive = 0
        }
    Else
        DVBViewerActive = 0
}

The complete code is here:
http://pastebin.com/PsYPXeAn
(2012-09-06, 16:11)baijuxavior Wrote: [ -> ]Yes you can change it. But remember to change the mce remote code for green start button also if you use mce remote. Because if you change Win+Alt+Enter in ahk code, this shortcut will start windows media center. But if you don't have an mce remote then it is ok to set the shortcut of your choice. The symbols to use are:

!: Sends an ALT keystroke.
+: Sends a SHIFT keystroke.
^: Sends a CONTROL keystroke
#: Sends a WIN keystroke

Actually would like to TOGGLE between 7MC (aka WMC) and XBMC that are both running simultaneous; TOGGLE using the GREEN BUTTON and of course change the focus to one or the other completely. Without starting any additional versions of either (only one instance of each running on my system). Without reading 25 pages of posts, can I get an expert to tell me has it been done? and if it makes sense to do so?

To me this makes a perfect solution, as WMC has a LIVETV solution that works well with my remote and for scheduling recordings, and my XBMC works great for everything else under the media world.

This might be possible using the code

Code:
#!Enter:: ; Win+Alt+Enter

WinGetActiveStats, Title, Width, Height, X, Y
if Title = XBMC
              WinActivate, ahk_class  eHome Render Window
else if Title = Windows Media Center
    WinActivate, ahk_class XBMC
Thanks baij will try that soon.
I'm guessing I need the AMD version if I have AMD APU?

One more quick question.....without windows shell will all my windows applications still be running....eg, utorrent, event ghost

Thanks, cheers?
AMD version is required only if you are running xbmclauncher as shell. In this case (shell) utorrent and eventghost will not start. You can edit the script file to add run commands for utorrent and eventghost. You could also use the included xbmconimon and imon path settings to select utorrent and eventghost.
How do i disable "S" and exclusively use "alt+f4" for the shutdown menu? thanks
Edit your keyboard.xml file. Also configure your mce remote to send Alt+F4 for the power button.
Hi,

I installed this as an shell and it works to certain degree but I still keep looking focus not sure what's causing it.

I installed the imon path too.

Windows 7 x64 with asrock motherboard.
AV installed nod32
Malwarebytes
I have autohotkeys installed
AMD gpu drivers 7750

How can I find out what's taking the focus?

Thanks.
Please set a lower time like 10 seconds for focus check. Also check whether Send Focus only once is enabled and disable it. Usually focus is lost when another gui application is running. When replacing shell usually there won't be another application but in your case it may be the imon program trying to display keypresses.