Advertisement
Guest User

AHK XBMC startup script

a guest
Jul 22nd, 2012
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. ;Win-Alt-Enter is the shortcut for greenbutton on the MCE Remote for Win64bit
  2. #!Enter::
  3. IfWinNotExist XBMC.exe ;If XBMC is shutdown
  4. Run C:\Program Files (x86)\XBMC 11\XBMC.exe ;Start it
  5. WinWait,XBMC,,8 ;wait for 8 seconds for XBMC to launch "increase the time if the script times out on your system"
  6. If ErrorLevel ;Display an error if XBMC does not load in time.
  7. {
  8. MsgBox, XBMC Startup timed out.
  9. return
  10. }
  11. WinActivate ;Activate and Refocus XBMC.
  12. WinShow ;Bring XBMC to front.
  13. WinGet, Style, Style, ahk_class XBMC
  14. if (Style & 0xC00000) ;Detects if XBMC has a title bar.
  15. {
  16. Send {VKDC} ;Maximize XBMC to fullscreen mode if its in a window mode.
  17. }
  18. Return
  19.  
  20.  
  21. SetTitleMatchMode 2
  22. #IfWinActive XBMC ahk_class XBMC ; XBMC detection for XBMC/GSB Home Screen action.
  23. #!Enter::
  24. WinGet, Style, Style, ahk_class XBMC
  25. if (Style & 0xC00000) ;0xC00000 is WS_CAPTION, meaning window has a title bar.
  26. {
  27. Send {VKDC} ;Maximize XBMC to fullscreen mode if its in a window mode.
  28. }
  29. WinMaximize ;Maximize XBMC if Windowed.
  30. send, ^!{VK74} ; if XBMC is Active (GSB Home Jump will activate)
  31. Return
  32. #IfWinActive ;
  33.  
  34.  
  35. ;Swap/Extend/activate & disable 2nd monitors script.
  36. ;Can be used by mapping one of your Remote buttons to [Control+F11] without the brackets.
  37. ^VK7A::
  38. if toggle := !toggle
  39. run % "displayswitch /" "extend"
  40. else
  41. run % "displayswitch /" "external"
  42.  
  43. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement