• 1
  • 242
  • 243
  • 244(current)
  • 245
  • 246
  • 453
[CLOSED] Advanced Launcher - Applications Launcher Addon for XBMC
Ok... so we stay into true fullscreen. Another try. Download another small application named NirCmd and also extract if into C:\WINDOWS directory. Then use a script like this :

Code:
#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>
HotKeySet("{ESC}", "Terminate")

If $CmdLine[0] == 1 Then
    Run("nomousy.exe /hide", "", @SW_HIDE)
    GUICreate('MyGUI', @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $WS_EX_TOPMOST))
    GUICtrlCreatePic('C:\Program Files (x86)\snes9x\loading_wallpaper.gif', 0, 0, @DesktopWidth, @DesktopHeight)
    GUISetState()
    Run("pssuspend XBMC.exe", "", @SW_HIDE)
    Run( '"C:\Program Files (x86)\snes9x\snes9x-x64.exe" -fullscreen -autostart "' & $CmdLine[1] & '"', "", @SW_HIDE)
    While 1
            Sleep(100)
    WEnd
EndIf
Terminate

Func Terminate()
    GUISetState()
    ProcessClose( "snes9x-x64.exe" )
    Run("pssuspend -r XBMC.exe", "", @SW_HIDE)
    Run ( "nircmd win max process XBMC.exe" )
    Run("nomousy.exe", "", @SW_HIDE)
    Exit 0
EndFunc

Does it fix your XBMC restoring focus problem?
Nircmd fixed the problem with restoring focus. The only problem remaining is that I can still see the windows taskbar and the mouse cursor flash when closing the application for about a second and sometimes for like... half a second when launching. It's not perfect, but I think it might be as close to perfect as is possible with AutoIt and it's a serious improvement over what it was before. This problem doesn't happen when using the window function of XBMC, but for some reason it becomes really choppy in full screen window.
(2012-07-09, 03:33)chris295 Wrote: Nircmd fixed the problem with restoring focus. The only problem remaining is that I can still see the windows taskbar and the mouse cursor flash when closing the application for about a second and sometimes for like... half a second when launching. It's not perfect, but I think it might be as close to perfect as is possible with AutoIt and it's a serious improvement over what it was before. This problem doesn't happen when using the window function of XBMC, but for some reason it becomes really choppy in full screen window.
Try with one :

Code:
#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>
HotKeySet("{ESC}", "Terminate")

If $CmdLine[0] == 1 Then
    Run("nomousy.exe /hide", "", @SW_HIDE)
    GUICreate('MyGUI', @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $WS_EX_TOPMOST))
    GUICtrlCreatePic('C:\Program Files (x86)\snes9x\loading_wallpaper.gif', 0, 0, @DesktopWidth, @DesktopHeight)
    GUISetState()
    Run("pssuspend XBMC.exe", "", @SW_HIDE)
    Run( '"C:\Program Files (x86)\snes9x\snes9x-x64.exe" -fullscreen -autostart "' & $CmdLine[1] & '"', "", @SW_HIDE)
    While 1
        Sleep(100)
    WEnd
EndIf
Terminate

Func Terminate()
    GUISetState()
    Run("pssuspend -r XBMC.exe", "", @SW_HIDE)
    Run ( "nircmd win max process XBMC.exe" )
    WinWaitActive ("XBMC")
    ProcessClose( "snes9x-x64.exe" )
    Run("nomousy.exe", "", @SW_HIDE)
    Exit 0
EndFunc

I have changed the way to close the application and restore XBMC. In fact, the script first restore XBMC, then wait until XBMC become active, and only after close the application.
Yet another improvement with that script. The mouse pointer no longer shows when exiting the application, but the task bar still flashes and the window title bar at the top of the screen flashes a few times. I can fix the taskbar showing by enabling "Auto Hide the Taskbar" in windows but no idea if it's possible to do anything about the flashing title bar.
(2012-07-09, 04:23)chris295 Wrote: Yet another improvement with that script. The mouse pointer no longer shows when exiting the application, but the task bar still flashes and the window title bar at the top of the screen flashes a few times. I can fix the taskbar showing by enabling "Auto Hide the Taskbar" in windows but no idea if it's possible to do anything about the flashing title bar.
I think it will be difficult to fix this. I did not see any task bar or title bar when using this script on my system. It is the title bar of which application ?

I'm not sure which title bar it is, it's in the shape of a title bar and the same size and position, but it's a solid color bar with no text. I think it's the XBMC window being maximized because it zooms up from the task bar.
(2012-07-09, 04:42)chris295 Wrote: I'm not sure which title bar it is, it's in the shape of a title bar and the same size and position, but it's a solid color bar with no text. I think it's the XBMC window being maximized because it zooms up from the task bar.
Could you confirm me that : XBMC video windows settings is set to "True fullscreen" and you launcher "Toogle Fullscreen" option is set to Off? If you invert these 2 following lines into the script :

Code:
Run("pssuspend -r XBMC.exe", "", @SW_HIDE)
Run ( "nircmd win max process XBMC.exe" )

does it improve something?
XBMC Video Window Setting is set to use the true fullscreen, not fullscreen window. Toggle Fullscreen option for the launcher is set to off.

If by inverting you mean to put the nircmd line above the xbmc command, doing that didn't seem to change anything. Just to be sure I did what you wanted me to, here is my "inverted" code:

Code:
#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>
HotKeySet("{ESC}", "Terminate")

If $CmdLine[0] == 1 Then
    Run("nomousy.exe /hide", "", @SW_HIDE)
    GUICreate('MyGUI', @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $WS_EX_TOPMOST))
    GUICtrlCreatePic('G:\xbmc\games\snes\loading_wallpaper.gif', 0, 0, @DesktopWidth, @DesktopHeight)
    GUISetState()
    Run("pssuspend XBMC.exe", "", @SW_HIDE)
    Run( '"G:\xbmc\games\snes\snes9x-x64.exe" -fullscreen -autostart "' & $CmdLine[1] & '"', "", @SW_HIDE)
    While 1
            Sleep(100)
    WEnd
EndIf
Terminate

Func Terminate()
    GUISetState()
    Run ( "nircmd win max process XBMC.exe" )
    Run("pssuspend -r XBMC.exe", "", @SW_HIDE)
    WinWaitActive ("XBMC")
    ProcessClose( "snes9x-x64.exe" )
    Run("nomousy.exe", "", @SW_HIDE)
    Exit 0
EndFunc
Yes, That's what I mean. I think I will not be able to do better. I have try to play this monitor and screensaver on/off features, but the results where not better than the use of the fullscreen GUI image. I think the title bar you see is the XBMC windows restoring to fullscreen.
Don't worry, I'm surprised you were able to get it as close to perfect as you have using nothing but AutoIt and a few small utilities. I really appreciate all the time you took refining the code. Hopefully in the future a solution can be integrated into advanced launcher (don't know if this is possible or not...?) but either way it's a huge improvement.

Thanks again!
(2012-07-09, 05:04)chris295 Wrote: Don't worry, I'm surprised you were able to get it as close to perfect as you have using nothing but AutoIt and a few small utilities. I really appreciate all the time you took refining the code. Hopefully in the future a solution can be integrated into advanced launcher (don't know if this is possible or not...?) but either way it's a huge improvement.

That practically impossible to integrate a script that will work in all the cases. The actual script is working great with SNES9X on your system, but I'm certain that it will not be suitable with all your applications or on another user system. Application softwares have different way to start and display (launcher or not, fullscreen or not, different graphical renderer, etc...). A script will never be able to predict all the possible cases.

Advantage of using external scripts (.BAT, .SH or autoit) is that users will be able to do exactly what they want on their system and modify the scripts to add for example controllers selection/activation, display selection, etc...

I can see where that would be a problem. After thinking about what you said, I wanted to find a universal solution so I don't have to deal with the hassle of modifying the scripts every time, as well as find a solution for the flashing title bar. I think I have come up with a solution that works for me and is perfect, as well as should work with any application on any PC. Also, should be noted that this method will disable the mouse pointer for the whole time you are using XBMC, but most people use remotes, controllers or the keyboard to navigate their HTPC anyway.

A few preparations must be made:

1. Set the Desktop Wallpaper to complete black. You can save this as a separate theme if you don't use your machine for an HTPC exclusively.

2. Right click on the desktop, hover over the "view" menu and uncheck "Show Desktop Icons". This is reversable and you can get all your icons back with their current positions by checking "Show Desktop Icons" again.

3. Set the launcher full screen toggle to "Off", otherwise XBMC will minimize when launching and you will see the XBMC window on the desktop.

4. Download "TaskBarHider", extract the program to C:\Windows.

5. Download nomousy and extract it to C:\Windows.

Code:
HotKeySet("{ESC}", "Terminate")

If $CmdLine[0] == 1 Then
    ProcessClose ( "XBMC.exe" )
    Run( '"G:\xbmc\games\snes\snes9x-x64.exe" -fullscreen -autostart "' & $CmdLine[1] & '"', "", @SW_HIDE)
    While 1
        Sleep(100)
    WEnd
EndIf

Func Terminate()
    ProcessClose ( "snes9x-x64.exe" )
    Run ( '"C:\Program Files (x86)\XBMC\XBMC.exe"' )
    Exit 0
EndFunc

I have used the processclose command because I don't think there is a way to use the suspend/resume command without the title bar showing when the script calls for XBMC to maximize. It's really not a big deal since XBMC starts up so quickly and I actually think I prefer it this way rather than returning to the games menu. It is completely seemless. No mouse pointer, no flashing screens, no taskbar and no title menus are displayed. The only disadventage is the amount of preperation that must be done before launching XBMC each time.

To solve this I'm trying to create a custom launcher for XBMC itself, but I'm a little stuck. XBMC seems to use it's own keyboard hook and ignores the hotkeyterminate function from AutoIt, so I can't figure out how to close XBMC with AutoIt. Maybe there is a way to make AutoIt perform the commands from the script when XBMC is closed in the normal way from the exit menu or some way to bypass the keyboard hook? My launcher code is as follows:

Code:
HotKeySet("{\}", "Terminate")

    Run("nomousy.exe /hide", "", @SW_HIDE)
    Run("TaskBarHider.exe -hide", "", @SW_HIDE)
    Run ( '"C:\Program Files (x86)\XBMC\XBMC.exe"' )

Func Terminate()
    Send("!{F4}")
    Run("nomousy.exe", "", @SW_HIDE)
    Run("TaskBarHider.exe -show -exit", "", @SW_HIDE)
    Exit 0
EndFunc

With this code, XBMC launches, the taskbar and mouse pointers are both hidden, but I can't test the rest of the script since XBMC doesn't terminate when I press \. Any tips on how to proceed?

Anyhow, I just wanted to post this for anyone who wanted a completely seemless solution. It's not really practical but maybe it can be with a modified launcher for XBMC using AutoIt. I also wanted to thank you again Angelscry for your work on Advanced Launcher and for your great support via the forums.
So it's been a few days now and you haven't responded yet. I'm guessing you didn't see my question in the wall of text... sorry about that. I'll repost it here just in case you happen to know the answer.

Is there a way to close XBMC with the terminate function, similar to how you close other applications with the terminate function using the Esc key? I have tried using the script I posted above, but it seems as though XBMC ignores the terminate function, similar to how Nestopia ignores it. If there isn't a way with Autoit, is there a way to instruct Autoit to perform the rest of the script when you exit XBMC in the normal way via the menu?

That way when using my custom launcher and closing XBMC, XBMC will restore the mouse pointer and taskbar. As it is now, XBMC will not terminate from the script so the rest of my script does not execute when closing XBMC.

thanks again
(2012-07-14, 01:42)chris295 Wrote: So it's been a few days now and you haven't responded yet. I'm guessing you didn't see my question in the wall of text... sorry about that. I'll repost it here just in case you happen to know the answer.

To be honest, I do not really undestand what you want to do.

(2012-07-14, 01:42)chris295 Wrote: Is there a way to close XBMC with the terminate function, similar to how you close other applications with the terminate function using the Esc key?

Must be possible, just assing xbmc.exe into the ProcessClose() autoit function.

(2012-07-14, 01:42)chris295 Wrote: I have tried using the script I posted above, but it seems as though XBMC ignores the terminate function, similar to how Nestopia ignores it.

If it is the case its mean that Nestopia and XBMC take the control on key pressed events over all the other running processes.

(2012-07-14, 01:42)chris295 Wrote: If there isn't a way with Autoit, is there a way to instruct Autoit to perform the rest of the script when you exit XBMC in the normal way via the menu?

You have the ProcessExist() function into autoit script that allow to tell you if a process is running or not : If XBMC.exe process do not exist -> continue the process.
you can use "emerge desktop" instead of "taskbarhider"...it will lighten your script because it remove the taskbar...
  • 1
  • 242
  • 243
  • 244(current)
  • 245
  • 246
  • 453

Logout Mark Read Team Forum Stats Members Help
[CLOSED] Advanced Launcher - Applications Launcher Addon for XBMC24