DonKarlosOn
Newbie | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Дано: ТВ подключен к встройке процессора кабелем HDMI. Это не основная видеокарта. Для того, чтобы ТВ увидел источник сигнала (встройку) перед просмотром фильмов, надо нажать Win+P, и выбрать вариант "Расширить экран". На свежепереустановленной Windows 10 та же картина. Хотелось автоматизировать это действие. Kodi у меня запускается с ПДУ Майкрософт через следующий скрипт (решение с просторов инета): Код: ;Written by EliteGamer360, Please give credit When you Copy and use my scripts for any other purpose. ;GSB_Script_Allinone_v2.39 #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance, Force ^!Enter:: ;Ctrl-Alt-Enter is the shortcut to start Kodi using the Big Green Start Button. IfWinNotExist Kodi.exe ;If Kodi is not running VarSetCapacity(si,44) DllCall("GetNativeSystemInfo", "uint", &si) if ErrorLevel { MsgBox Windows XP or later required. ExitApp } ARM := NumGet(si,0,"ushort") run % ARM=0 ? "D:\Programs\Kodi\Kodi.exe" : ARM=9 ? "D:\Programs\Kodi\Kodi.exe" : ARM=6 ? "IA64" : "Unknown System" f (ARM = 0) { 32or64 := "32bit" } If (ARM = 9) { 32or64 := "64bit" } If (ARM = 6) { 32or64 := "Unknown System" } WinActivate ;Activate and Refocus Kodi. WinShow ;Bring Kodi to front. WinGet, Style, Style, ahk_class Kodi if (Style & 0xC00000) ;0xC00000 is WS_CAPTION, meaning window has a title bar. { Send {VKDC} ;Maximize Kodi to fullscreen mode if its in a window mode. } Return SetTitleMatchMode 2 #IfWinActive Kodi ahk_class Kodi ; Kodi detection for Kodi/GSB Home Screen action. ^!Enter:: WinGet, Style, Style, ahk_class Kodi if (Style & 0xC00000) ;0xC00000 is WS_CAPTION, meaning window has a title bar. { Send {VKDC} ;Maximize Kodi to fullscreen mode if its in a window mode. } ;WinMaximize ;Maximize Kodi if Windowed. send, ^!{VK74} ; if Kodi is Active (GSB Home Jump will activate) Return #IfWinActive ; ^F11:: ;Swap/Extend/activate monitors script if toggle := !toggle run % "displayswitch /" "extend" else run % "displayswitch /" "external" Run, mmsys.cpl WinWait,Sound ControlSend,SysListView321,{Down3} ControlGet, isEnabled, Enabled,,&Set Default if(!isEnabled) { ControlSend,SysListView321,{Down} } ControlClick,&Set Default ControlClick,OK WinWaitClose SoundPlay, *-1 return ^VK7B:: ; CTRL+F12 to activate/deactivate SmartFocus KeepWinZRunning := (KeepWinZRunning || KeepWinZRunning = "") ? False : True if (!KeepWinZRunning) { SoundPlay, %A_AppData%\Xbmccustomregis\smartfocusactivated.mp3 SetTimer, WindowCheck, 250 } Else SoundPlay, %A_AppData%\Xbmccustomregis\smartfocusdeactivated.mp3 Return WindowCheck: ; Below checks if the KODI window is activate If WinExist("Kodi") && !WinActive("Kodi") { WinActivate, Kodi WinMaximize, Kodi } if (KeepWinZRunning) ; The user signaled the loop to stop by pressing CTRL+F12 again. SetTimer, WindowCheck, Off ; Break out of this loop. Return ;Written by EliteGamer360, Please give credit When you Copy and use my scripts for any other purpose. ;Copyright @ XBMCCUSTOMREGIS.SOURCEFORGE.NET | Прошу помощи. Нужно поправить его так, чтобы ТВ увидел встройку ПЕРЕД запуском Kodi. В скрипте уже имеется следующая команда: Код: ^F11:: ;Swap/Extend/activate monitors script if toggle := !toggle run % "displayswitch /" "extend" else run % "displayswitch /" "external" Run, mmsys.cpl WinWait,Sound ControlSend,SysListView321,{Down3} ControlGet, isEnabled, Enabled,,&Set Default if(!isEnabled) { ControlSend,SysListView321,{Down} } ControlClick,&Set Default ControlClick,OK WinWaitClose SoundPlay, *-1 return | Предположу, что мне нужно что-то типа run % "displayswitch /" "extend"? Вопрос в том, как будет выглядеть полная команда и в какое место скрипта ее вставить? Спасибо. |