Advertisement
Emagin

XBMC Green Button Windows

Feb 11th, 2013
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Written by EliteGamer360, Please give credit When you Copy and use my scripts for any other purpose.
  2. ;Script source is http://xbmccustomregis.sourceforge.net/features.html
  3.  
  4. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  5. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  6. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  7.  
  8. #SingleInstance, Force
  9. ^!Enter::   ;Ctrl-Alt-Enter is the shortcut for greenbutton_Win64bit
  10.     IfWinNotExist XBMC.exe ;If XBMC is not running
  11.     VarSetCapacity(si,44)
  12.     DllCall("GetNativeSystemInfo", "uint", &si)
  13.         if ErrorLevel {
  14.         MsgBox Windows XP or later required.
  15.         ExitApp
  16.     }
  17.         ARM := NumGet(si,0,"ushort")
  18.         run % ARM=0 ? "C:\Program Files\XBMC\XBMC.exe" : ARM=9 ? "C:\Program Files (x86)\XBMC\XBMC.exe" : ARM=6 ? "IA64" : "Unknown System"
  19.  
  20.         f (ARM = 0)
  21.         {
  22.             32or64 := "32bit"
  23.         }
  24.         If (ARM = 9)
  25.         {
  26.             32or64 := "64bit"
  27.         }
  28.         If (ARM = 6)
  29.         {
  30.             32or64 := "Unknown System"
  31.     }
  32.  
  33.     WinActivate ;Activate and Refocus XBMC.
  34.     WinShow ;Bring XBMC to front.
  35.     WinGet, Style, Style, ahk_class XBMC
  36.     if (Style & 0xC00000)  ;0xC00000 is WS_CAPTION, meaning window has a title bar.
  37.     {
  38.         Send {VKDC}  ;Maximize XBMC to fullscreen mode if its in a window mode.
  39.     }
  40.     Return
  41.  
  42.  
  43.         SetTitleMatchMode 2
  44.         #IfWinActive XBMC ahk_class XBMC ; XBMC detection for XBMC/GSB Home Screen action.
  45.         ^!Enter::
  46.         WinGet, Style, Style, ahk_class XBMC
  47.         if (Style & 0xC00000)  ;0xC00000 is WS_CAPTION, meaning window has a title bar.
  48.         {
  49.                 Send {VKDC}  ;Maximize XBMC to fullscreen mode if its in a window mode.
  50.         }
  51.         ;WinMaximize ;Maximize XBMC if Windowed.
  52.         send, ^!{VK74} ; if XBMC is Active (GSB Home Jump will activate)
  53.         Return
  54.         #IfWinActive ;
  55.  
  56.  
  57. ^F11::  ;Swap/Extend/activate monitors script
  58.     if toggle := !toggle
  59.         run % "displayswitch /" "extend"
  60.         else
  61.         run % "displayswitch /" "external"
  62.             Run, mmsys.cpl
  63.                 WinWait,Sound
  64.                 ControlSend,SysListView321,{Down3}
  65.                 ControlGet, isEnabled, Enabled,,&Set Default
  66.             if(!isEnabled)
  67.             {
  68.                 ControlSend,SysListView321,{Down}
  69.             }
  70.             ControlClick,&Set Default
  71.             ControlClick,OK
  72.             WinWaitClose
  73.             SoundPlay, *-1
  74.         return
  75.  
  76.  
  77.     ^VK7B::  ; CTRL+F12 to activate/deactivate SmartFocus
  78.         KeepWinZRunning := (KeepWinZRunning || KeepWinZRunning = "") ? False : True
  79.         if (!KeepWinZRunning)
  80.            {
  81.             SoundPlay, %A_AppData%\Xbmccustomregis\smartfocusactivated.mp3
  82.             SetTimer, WindowCheck, 20
  83.            }
  84.         Else
  85.             SoundPlay, %A_AppData%\Xbmccustomregis\smartfocusdeactivated.mp3
  86.                 Return
  87.  
  88.         WindowCheck: ; Below checks if the XBMC window is activate
  89.             If WinExist("XBMC") && !WinActive("XBMC")
  90.                 {
  91.                     WinActivate, XBMC
  92.                     WinMaximize, XBMC
  93.                 }
  94.             if (KeepWinZRunning)  ; The user signaled the loop to stop by pressing CTRL+F12 again.
  95.                 SetTimer, WindowCheck, Off  ; Break out of this loop.
  96.         Return
  97.             ;Written by EliteGamer360, Please give credit When you Copy and use my scripts for any other purpose.
  98.             ;Copyright @ XBMCCUSTOMREGIS.SOURCEFORGE.NET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement