<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: OSD Remote menu]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9286&amp;type=atom" />
	<updated>2014-02-22T20:40:34Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=9286</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80287#p80287" />
			<content type="html"><![CDATA[<p>О-оо! Какие люди! ...&nbsp; &nbsp;<img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> <br />Теперь все заработало корректно. Спасибо, <strong>serzh82saratov</strong>! Просто я еще &quot;не догнал&quot;, что в этих двух строках кода <strong>teadrinker</strong> наколдовал, но так и предполагал, что копать надо в эту сторону. </p><div class="codebox"><pre><code>CurrentChoice += (A_ThisLabel = &quot;OSD_Up&quot; ? -1 : 1)
CurrentChoice := (CurrentChoice &gt; MaxChoice ? 1 : CurrentChoice = 0 ? MaxChoice : CurrentChoice)</code></pre></div><p>- рабочий вариант! Это для интеграции в WinLIRC клиент, если кому понадобится. ... На всякий случай выложу код меню, работающей от клавы:</p><div class="codebox"><pre><code>#NoEnv
#NoTrayIcon
#Persistent
#SingleInstance, Force

CurrentChoice := 1    ; выбранная строка
MaxChoice := 6         ; общее количество строк

CustomColor = 000000
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, %CustomColor%
Gui, Font, s46 Bold, Cambria
Gui, Add, Text, Center y+88 w1684 h92 vOSD1 cRed gStr1, J.River Media Center
Gui, Add, Text, Center w1684 h92 vOSD2 cYellow gStr2, DVB Dream
Gui, Add, Text, Center w1684 h92 vOSD3 cYellow gStr3, Daum PotPlayer
Gui, Add, Text, Center w1684 h92 vOSD4 cYellow gStr4, RadioTime RedButton
Gui, Add, Text, Center w1684 h92 vOSD5 cYellow gStr5, Открыть DVD привод
Gui, Add, Text, Center w1684 h92 vOSD6 cYellow gStr6, Выключить компьютер
Gui, Show, Center h920 w1800 NoActivate, OSD Remote Menu
WinSet, Region, 0-0 h920 w1800 R160-160, OSD Remote Menu
WinSet, Transparent, 200, OSD Remote Menu
return

Str1:
Str2:
Str3:
Str4:
Str5:
Str6:
    if !PressEnter
        {
        SetFont(&quot;s46 cYellow&quot;, &quot;OSD&quot; CurrentChoice)
        CurrentChoice := SubStr(A_GuiControl, 0)
        SetFont(&quot;s56 cRed&quot;, &quot;OSD&quot; CurrentChoice)
        }
    PressEnter := &quot;&quot;
    SetFont(&quot;s46 cGreen&quot;, &quot;OSD&quot; CurrentChoice)
    
    if (A_ThisLabel = &quot;Str1&quot;)
        {
        Run, notepad
        }
    else if (A_ThisLabel = &quot;Str2&quot;)
        {
        Run, notepad
        }
    else if (A_ThisLabel = &quot;Str3&quot;)
        {
        Run, notepad
        }
    else if (A_ThisLabel = &quot;Str4&quot;)
        {
        Run, notepad
        }
    else if (A_ThisLabel = &quot;Str5&quot;)
        {
        Run, notepad
        }
    else if (A_ThisLabel = &quot;Str6&quot;)
        {
        Run, notepad
        }
        
Loop, 100
    {
    TransFade := 200 - A_Index
    WinSet, Transparent, %TransFade%, OSD Remote Menu
    Sleep, 1
    }
    
GuiClose:
ExitApp

#IfWinExist, OSD Remote Menu ahk_class AutoHotkeyGUI
Up::
Down::
    SetFont(&quot;s46 cYellow&quot;, &quot;OSD&quot; CurrentChoice)
    
    CurrentChoice += (A_ThisHotkey = &quot;Up&quot; ? -1 : 1)
    CurrentChoice := (CurrentChoice &gt; MaxChoice ? 1 : CurrentChoice = 0 ? MaxChoice : CurrentChoice)
    
    SetFont(&quot;s56 cRed&quot;, &quot;OSD&quot; CurrentChoice)
    return
    
Enter::
    PressEnter := 1
    goto, Str%CurrentChoice%
    return
    
SetFont(Options, Control)
    {
    Gui, Font, % Options
    GuiControl, Font, % Control
    }
</code></pre></div><p>Здесь добавил изменение цвета и размера шрифта выбранного пункта меню после нажатия клавиши. Получился неплохой эффект ...</p><p>Всем большущее благодарю за помощь!</p><p>Вопрос решен.</p>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-22T20:40:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80287#p80287</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80272#p80272" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>CurrentChoice += (A_ThisHotkey = &quot;OSD_Up&quot; ? -1 : 1)</code></pre></div><p>На первый взгляд, заменить A_ThisHotkey на A_ThisLabel.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-02-22T17:55:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80272#p80272</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80261#p80261" />
			<content type="html"><![CDATA[<p>Заработало! ... &quot;Вшил&quot; скрипт в AVerLIRC Client и посадил напрямую на кнопки IR пульта. Вот только теперь перемотка работает только вниз на обеих клавишах &lt;Up&gt; и &lt;Down&gt; пульта. Как это исправить?</p><p>Вот код скрипта, где внес изменения:</p><div class="codebox"><pre><code>#IfWinExist, OSD Remote Menu ahk_class AutoHotkeyGUI
OSD_Up:
OSD_Down:
    SetFont(&quot;s46 cYellow&quot;, &quot;OSD&quot; CurrentChoice)
    
    CurrentChoice += (A_ThisHotkey = &quot;OSD_Up&quot; ? -1 : 1)
    CurrentChoice := (CurrentChoice &gt; MaxChoice ? 1 : CurrentChoice = 0 ? MaxChoice : CurrentChoice)
    
    SetFont(&quot;s56 cRed&quot;, &quot;OSD&quot; CurrentChoice)
    return
    
OSD_Enter:
    PressEnter := 1
    goto, Str%CurrentChoice%
    return
    
SetFont(Options, Control)
    {
    Gui, Font, % Options
    GuiControl, Font, % Control
    }</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-22T07:25:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80261#p80261</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80259#p80259" />
			<content type="html"><![CDATA[<p>Вопрос не совсем в тему: можно ли на одну клавишу повесить несколько действий?<br />Например, нажимаешь клавишу &lt;A&gt; один раз - откроется calc.exe, нажимаешь два раза подряд - откроется notepad.exe, нажмешь три раз подряд - откроется mspaint.exe ... и так далее.</p><p>Есть мысль - повесить таким образом на одну клавишу IR пульта запуск разных приложений ... Конечно, это будет не столь эффектно, как OSD меню, но это тоже выход ....</p>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-22T02:04:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80259#p80259</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80258#p80258" />
			<content type="html"><![CDATA[<p>... Вдруг мысль пришла: а что если попробовать повесить эти три кнопки не на клаву, а напрямую - на кнопки IR пульта?<br />Я ведь управление настраиваю тоже на AHK - WinLIRC Client, взятый из стандартной справки ...&nbsp; получается двойная эмуляция.</p><p>Возможно и заработает&nbsp; .... вот только как это лучше сделать? Может есть мысли?</p><p>Выложу свой вариант WinLIRC Client адаптированный к AVerLIRC ( тот-же WinLIRC для тюнеров AVer )</p><div class="codebox"><pre><code>#NoEnv
SendMode Input

; Запуск программы от имени Админа
If not A_IsAdmin
{
Run *RunAs &quot;%A_ScriptFullPath%&quot;
ExitApp
}

Process, Priority,, HIGH ; Установить приоритет процесса скрипта в High (высокий).

DelayBetweenButtonRepeats = 200

; Specify AVerLIRC&#039;s address and port. The most common are 127.0.0.1 (localhost) and 8765.
AVerLIRC_Address = 127.0.0.1
AVerLIRC_Port = 666

; Do not change the following two lines. Skip them and continue below.
Gosub AVerLIRC_Init
return

; ----------------------------------------------------
; Назначение действий для кнопок пульта AVerMedia-H831
; ----------------------------------------------------
; J.River Media Center
;--------------------------------------------------
Source:
return
;--------------------------------------------------
Power:
Run, OSD-RemoteMenu.ahk
return
;--------------------------------------------------
Full_screen:
Run, mc19.exe /mcc 22000`,2
GoTo UpdateTime
return
;--------------------------------------------------
Record:
Send {vk26} ; &lt;Up&gt;
;Run, mc19.exe /mcc 27000`,38
return
;--------------------------------------------------
; Кнопка для всех программ
Audio:
Process, Exist, Watch.exe
    {
    If ! ErrorLevel
        {
        Run, Watch.exe
        }
        Else
            {
            Process, Close, Watch.exe
            }
    }
return
;--------------------------------------------------
Rewind:
Run, mc19.exe /mcc 27000`,37
return
;--------------------------------------------------
Play/Pause:
Send {vkD} ; &lt;Enter&gt;
;Run, mc19.exe /mcc 27000`,13
return
;--------------------------------------------------
Forward:
Run, mc19.exe /mcc 27000`,39
return
;--------------------------------------------------
Display:
Run, mc19.exe /mcc 10009
return
;--------------------------------------------------
Stop:
Send {vk28} ; &lt;Down&gt;
;Run, mc19.exe /mcc 27000`,40
return
;--------------------------------------------------
EPG:
Run, mc19.exe /mcc 10008
return
;--------------------------------------------------
; Кнопка для всех программ
Vol+:
Send {vkAF}
SoundSet +2
return
;--------------------------------------------------
Ch+:
Run, mc19.exe /mcc 10003
return
;--------------------------------------------------
; Кнопка для всех программ
Vol-:
Send {vkAE}
SoundSet -2
return
;--------------------------------------------------
Ch-:
Run, mc19.exe /mcc 10004
return
;--------------------------------------------------
1:
Run, mc19.exe /mcc 27000`,97
return
;--------------------------------------------------
2:
Run, mc19.exe /mcc 27000`,98
return
;--------------------------------------------------
3:
Run, mc19.exe /mcc 27000`,99
return
;--------------------------------------------------
4:
Run, mc19.exe /mcc 27000`,100
return
;--------------------------------------------------
5:
Run, mc19.exe /mcc 27000`,101
return
;--------------------------------------------------
6:
Run, mc19.exe /mcc 27000`,102
return
;--------------------------------------------------
7:
Run, mc19.exe /mcc 27000`,103
return
;--------------------------------------------------
8:
Run, mc19.exe /mcc 27000`,104
return
;--------------------------------------------------
9:
Run, mc19.exe /mcc 27000`,105
return
;--------------------------------------------------
Ch_Return:
return
;--------------------------------------------------
0:
Run, mc19.exe /mcc 27000`,96
return
;--------------------------------------------------
; Кнопка для всех программ
Mute:
Send {vkAD}
return
;--------------------------------------------------
; Sub - обновление часов
UpdateTime:

Process, Exist, Watch.exe
    {
    If ErrorLevel
        {
        Process, Close, Watch.exe
        Sleep, 500
        Run, Watch.exe
        }
    }
return
;--------------------------------------------------

; ----------------------------
; END OF CONFIGURATION SECTION
; ----------------------------
; Do not make changes below this point unless you want to change the core
; functionality of the script.

AVerLIRC_Init:
OnExit, ExitSub  ; For connection cleanup purposes.

; Launch AVerLIRC if it isn&#039;t already running:
Process, Exist, averlirc.exe
if ! ErrorLevel  ; No PID for AVerLIRC was found.
{
    MsgBox, 0x30, AVerLIRC Client, Похоже`, AVerLIRC не запущен.`n`nПытаюсь подключить сервер., 2
    RunWait, net start averlirc, , Hide
}

; Connect to AVerLIRC (or any type of server for that matter):
socket := ConnectToAddress(AVerLIRC_Address, AVerLIRC_Port)
if socket = -1  ; Connection failed (it already displayed the reason).
    ExitApp

; Find this script&#039;s main window:
Process, Exist  ; This sets ErrorLevel to this script&#039;s PID (it&#039;s done this way to support compiled scripts).
DetectHiddenWindows On
ScriptMainWindowId := WinExist(&quot;ahk_class AutoHotkey ahk_pid &quot; . ErrorLevel)
DetectHiddenWindows Off

; When the OS notifies the script that there is incoming data waiting to be received,
; the following causes a function to be launched to read the data:
NotificationMsg = 0x5555  ; An arbitrary message number, but should be greater than 0x1000.
OnMessage(NotificationMsg, &quot;ReceiveData&quot;)

; Set up the connection to notify this script via message whenever new data has arrived.
; This avoids the need to poll the connection and thus cuts down on resource usage.
FD_READ = 1     ; Received when data is available to be read.
FD_CLOSE = 32   ; Received when connection has been closed.
if DllCall(&quot;Ws2_32\WSAAsyncSelect&quot;, &quot;UInt&quot;, socket, &quot;UInt&quot;, ScriptMainWindowId, &quot;UInt&quot;, NotificationMsg, &quot;Int&quot;, FD_READ|FD_CLOSE)
{
    MsgBox % &quot;WSAAsyncSelect() indicated Winsock error &quot; . DllCall(&quot;Ws2_32\WSAGetLastError&quot;)
    ExitApp
}
return



ConnectToAddress(IPAddress, Port)
; This can connect to most types of TCP servers, not just AVerLIRC.
; Returns -1 (INVALID_SOCKET) upon failure or the socket ID upon success.
{
    VarSetCapacity(wsaData, 400)
    result := DllCall(&quot;Ws2_32\WSAStartup&quot;, &quot;UShort&quot;, 0x0002, &quot;UInt&quot;, &amp;wsaData) ; Request Winsock 2.0 (0x0002)
    ; Since WSAStartup() will likely be the first Winsock function called by this script,
    ; check ErrorLevel to see if the OS has Winsock 2.0 available:
    if ErrorLevel
    {
        MsgBox WSAStartup() could not be called due to error %ErrorLevel%. Winsock 2.0 or higher is required.
        return -1
    }
    if result  ; Non-zero, which means it failed (most Winsock functions return 0 upon success).
    {
        MsgBox % &quot;WSAStartup() indicated Winsock error &quot; . DllCall(&quot;Ws2_32\WSAGetLastError&quot;)
        return -1
    }

    AF_INET = 2
    SOCK_STREAM = 1
    IPPROTO_TCP = 6
    socket := DllCall(&quot;Ws2_32\socket&quot;, &quot;Int&quot;, AF_INET, &quot;Int&quot;, SOCK_STREAM, &quot;Int&quot;, IPPROTO_TCP)
    if socket = -1
    {
        MsgBox % &quot;socket() indicated Winsock error &quot; . DllCall(&quot;Ws2_32\WSAGetLastError&quot;)
        return -1
    }

    ; Prepare for connection:
    SizeOfSocketAddress = 16
    VarSetCapacity(SocketAddress, SizeOfSocketAddress)
    InsertInteger(2, SocketAddress, 0, AF_INET)   ; sin_family
    InsertInteger(DllCall(&quot;Ws2_32\htons&quot;, &quot;UShort&quot;, Port), SocketAddress, 2, 2)   ; sin_port
    InsertInteger(DllCall(&quot;Ws2_32\inet_addr&quot;, &quot;Str&quot;, IPAddress), SocketAddress, 4, 4)   ; sin_addr.s_addr

    ; Attempt connection:
    if DllCall(&quot;Ws2_32\connect&quot;, &quot;UInt&quot;, socket, &quot;UInt&quot;, &amp;SocketAddress, &quot;Int&quot;, SizeOfSocketAddress)
    {
        MsgBox % &quot;connect() indicated Winsock error &quot; . DllCall(&quot;Ws2_32\WSAGetLastError&quot;) . &quot;. Is AVerLIRC running?&quot;
        return -1
    }
    return socket  ; Indicate success by returning a valid socket ID rather than -1.
}



ReceiveData(wParam, lParam)
; By means of OnMessage(), this function has been set up to be called automatically whenever new data
; arrives on the connection.  It reads the data from AVerLIRC and takes appropriate action depending
; on the contents.
{
    Critical  ; Prevents another of the same message from being discarded due to thread-already-running.
    socket := wParam
    ReceivedDataSize = 4096  ; Large in case a lot of data gets buffered due to delay in processing previous data.

    VarSetCapacity(ReceivedData, ReceivedDataSize, 0)  ; 0 for last param terminates string for use with recv().
    ReceivedDataLength := DllCall(&quot;Ws2_32\recv&quot;, &quot;UInt&quot;, socket, &quot;Str&quot;, ReceivedData, &quot;Int&quot;, ReceivedDataSize, &quot;Int&quot;, 0)
    if ReceivedDataLength = 0  ; The connection was gracefully closed, probably due to exiting AVerLIRC.
        ExitApp  ; The OnExit routine will call WSACleanup() for us.
    if ReceivedDataLength = -1
    {
        WinsockError := DllCall(&quot;Ws2_32\WSAGetLastError&quot;)
        if WinsockError = 10035  ; WSAEWOULDBLOCK, which means &quot;no more data to be read&quot;.
            return 1
        if WinsockError &lt;&gt; 10054 ; WSAECONNRESET, which happens when AVerLIRC closes via system shutdown/logoff.
            ; Since it&#039;s an unexpected error, report it.  Also exit to avoid infinite loop.
            MsgBox % &quot;recv() indicated Winsock error &quot; . WinsockError
        ExitApp  ; The OnExit routine will call WSACleanup() for us.
    }
    ; Otherwise, process the data received. Testing shows that it&#039;s possible to get more than one line
    ; at a time (even for explicitly-sent IR signals), which the following method handles properly.
    ; Data received from AVerLIRC looks like the following example (see the AVerLIRC docs for details):
    ; 0000000000eab154 00 NameOfButton NameOfRemote
    Loop, parse, ReceivedData, `n, `r
    {
        if A_LoopField in ,BEGIN,SIGHUP,END  ; Ignore blank lines and AVerLIRC&#039;s start-up messages.
            continue
        ButtonName =  ; Init to blank in case there are less than 3 fields found below.
        Loop, parse, A_LoopField, %A_Space%  ; Extract the button name, which is the third field.
            if A_Index = 3
                ButtonName := A_LoopField
        global DelayBetweenButtonRepeats  ; Declare globals to make them available to this function.
        static PrevButtonName, PrevButtonTime, RepeatCount  ; These variables remember their values between calls.
        if (ButtonName != PrevButtonName || A_TickCount - PrevButtonTime &gt; DelayBetweenButtonRepeats)
        {
            if IsLabel(ButtonName)  ; There is a subroutine associated with this button.
                Gosub %ButtonName%  ; Launch the subroutine.
            else ; Since there is no associated subroutine, briefly display which button was pressed.
            {
                if (ButtonName == PrevButtonName)
                    RepeatCount += 1
                else
                    RepeatCount = 1
                SplashTextOn, 150, 20, Button from AVerLIRC, %ButtonName% (%RepeatCount%)
                SetTimer, SplashOff, 3000  ; This allows more signals to be processed while displaying the window.
            }
            PrevButtonName := ButtonName
            PrevButtonTime := A_TickCount
        }
    }
    return 1  ; Tell the program that no further processing of this message is needed.
}



SplashOff:
SplashTextOff
SetTimer, SplashOff, Off
return



InsertInteger(pInteger, ByRef pDest, pOffset = 0, pSize = 4)
; The caller must ensure that pDest has sufficient capacity.  To preserve any existing contents in pDest,
; only pSize number of bytes starting at pOffset are altered in it.
{
    Loop %pSize%  ; Copy each byte in the integer into the structure as raw binary data.
        DllCall(&quot;RtlFillMemory&quot;, &quot;UInt&quot;, &amp;pDest + pOffset + A_Index-1, &quot;UInt&quot;, 1, &quot;UChar&quot;, pInteger &gt;&gt; 8*(A_Index-1) &amp; 0xFF)
}



ExitSub:  ; This subroutine is called automatically when the script exits for any reason.
; MSDN: &quot;Any sockets open when WSACleanup is called are reset and automatically
; deallocated as if closesocket was called.&quot;
DllCall(&quot;Ws2_32\WSACleanup&quot;)
ExitApp
</code></pre></div><br /><br /><p>Может здесь лучше использовать #Include OSD-RemoteMenu.ahk или непосредственно &quot;вшить&quot; в этот скрипт? Какие предложения?</p><p>... Собсна, названия кнопок, на которые надо повесить, с закомментированными названиями клавиш.</p>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-21T23:49:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80258#p80258</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80251#p80251" />
			<content type="html"><![CDATA[<p>Не, с пультом не работал, не подскажу.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-02-21T15:01:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80251#p80251</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80250#p80250" />
			<content type="html"><![CDATA[<p>Обидно ... вся эта конструкция почему-то не хочет работать с пультом. Через клаву прокрутка по меню идет без проблем, а на пульт WinLIRC не реагирует. Хотя во всех программах пульт работает - и эмуляция всех клавиш идет нормально .... Что может быть?</p>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-21T14:40:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80250#p80250</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80242#p80242" />
			<content type="html"><![CDATA[<p>Похоже, сделал!</p><p>Вот, что наваял:</p><div class="codebox"><pre><code>#NoEnv
#NoTrayIcon
#Persistent
#SingleInstance, Force

CurrentChoice := 1    ; выбранная строка
MaxChoice := 6         ; общее количество строк

CustomColor = 000000
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, %CustomColor%
Gui, Font, s46 Bold, Cambria
Gui, Add, Text, Center y+88 w1684 h92 vOSD1 cRed gStr1, J.River Media Center
Gui, Add, Text, Center w1684 h92 vOSD2 cYellow gStr2, DVB Dream
Gui, Add, Text, Center w1684 h92 vOSD3 cYellow gStr3, Daum PotPlayer
Gui, Add, Text, Center w1684 h92 vOSD4 cYellow gStr4, RadioTime RedButton
Gui, Add, Text, Center w1684 h92 vOSD5 cYellow gStr5, Открыть DVD привод
Gui, Add, Text, Center w1684 h92 vOSD6 cYellow gStr6, Выключить компьютер
Gui, Show, Center h920 w1800 NoActivate, OSD Remote Menu
WinSet, Region, 0-0 h920 w1800 R160-160, OSD Remote Menu
WinSet, Transparent, 200, OSD Remote Menu
return

Str1:
Str2:
Str3:
Str4:
Str5:
Str6:
    if !PressEnter
        {
        SetFont(&quot;s46 cYellow&quot;, &quot;OSD&quot; CurrentChoice)
        CurrentChoice := SubStr(A_GuiControl, 0)
        SetFont(&quot;s56 cRed&quot;, &quot;OSD&quot; CurrentChoice)
        }
    PressEnter := &quot;&quot;
    
    if (A_ThisLabel = &quot;Str1&quot;)
        {
        Run, calc
        }
    else if (A_ThisLabel = &quot;Str2&quot;)
        {
        Run, notepad
        }
    else if (A_ThisLabel = &quot;Str3&quot;)
        {
        Run, notepad
        }
    else if (A_ThisLabel = &quot;Str4&quot;)
        {
        Run, notepad
        }
    else if (A_ThisLabel = &quot;Str5&quot;)
        {
        Run, notepad
        }
    else if (A_ThisLabel = &quot;Str6&quot;)
        {
        Run, notepad
        }
        
Loop, 100
    {
    TransFade := 200 - A_Index
    WinSet, Transparent, %TransFade%, OSD Remote Menu
    Sleep, 1
    }
    
GuiClose:
ExitApp

#IfWinExist, OSD Remote Menu ahk_class AutoHotkeyGUI
Up::
Down::
    SetFont(&quot;s46 cYellow&quot;, &quot;OSD&quot; CurrentChoice)
    
    CurrentChoice += (A_ThisHotkey = &quot;Up&quot; ? -1 : 1)
    CurrentChoice := (CurrentChoice &gt; MaxChoice ? 1 : CurrentChoice = 0 ? MaxChoice : CurrentChoice)
    
    SetFont(&quot;s56 cRed&quot;, &quot;OSD&quot; CurrentChoice)
    return
    
Enter::
    PressEnter := 1
    goto, Str%CurrentChoice%
    return
    
SetFont(Options, Control)
    {
    Gui, Font, % Options
    GuiControl, Font, % Control
    }
</code></pre></div><p>Размеры подогнал под свой монитор с разрешением 1920 X 1080. Осталось только команды на запуск программ прописать.</p><p>Вроде, симпатично получилось ... жаль, что нельзя сделать непрозрачный текст на полупрозрачном фоне! <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" />&nbsp; Пришлось фон менее прозрачным сделать, чтобы читабельно было.</p>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-21T12:10:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80242#p80242</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80232#p80232" />
			<content type="html"><![CDATA[<p>Изменил эти строки:</p><p>SetFont(&quot;s30 cBlue&quot;, &quot;Text&quot; CurrentChoice)</p><p>SetFont(&quot;s40 cRed&quot;, &quot;Text&quot; CurrentChoice)</p><p>Пришлось изменить и это:</p><p>Gui, Font, s40 Bold, Cambria</p><p>Если оставить как было s30 , то при выборе строки и увеличении шрифта, получается строка обрезана. Типа &quot;Нажать для запу&quot; .</p><p>В общем, это работает на уменьшение не выбранного пункта, а не на увеличение выбранного ...</p><p>... или я что-то не так делаю?</p>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-21T04:29:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80232#p80232</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80230#p80230" />
			<content type="html"><![CDATA[<p>Отредактировал, чтобы шрифт менялся при клике по строчке.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-02-20T22:58:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80230#p80230</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80229#p80229" />
			<content type="html"><![CDATA[<p>ОК! Дальше сам попробую разобраться ... а то совсем обленюсь. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>БОЛЬШУЩЕЕ БЛАГОДАРЮ за помощь!</p>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-20T22:38:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80229#p80229</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80228#p80228" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Dr.Jekyll пишет:</cite><blockquote><p>.... не перестаю удивляться! <strong>teadrinker</strong>, Вы - ТАЛАНТИЩЕ! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>... А можно еще добавить изменение размера пункта меню, находящегося в фокусе? Как в первом скрипте ...</p></blockquote></div><p>Считайте это домашним заданием <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-02-20T22:33:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80228#p80228</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80227#p80227" />
			<content type="html"><![CDATA[<p>.... не перестаю удивляться! <strong>teadrinker</strong>, Вы - ТАЛАНТИЩЕ! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>... А можно еще добавить изменение размера пункта меню, находящегося в фокусе? Как в первом скрипте ...</p>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-20T22:31:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80227#p80227</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80226#p80226" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>CurrentChoice := 1   ; выбранная строка
MaxChoice := 2       ; общее количество строк

CustomColor = EEAA99
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, %CustomColor%
Gui, Font, s30 Bold, Cambria
Gui, Add, Text, vText1 cRed gStr1, Нажать для запуска калькулятора.
Gui, Add, Text, vText2 cBlue gStr2, Нажать для запуска текстового редактора.
WinSet, TransColor, %CustomColor% 150
Gui, Show, x450 y0 NoActivate, Watch
return

Str1:
Str2:
   if !PressEnter
   {
      SetFont(&quot;cBlue&quot;, &quot;Text&quot; CurrentChoice)
      CurrentChoice := SubStr(A_GuiControl, 0)
      SetFont(&quot;cRed&quot;, &quot;Text&quot; CurrentChoice)
   }
   PressEnter := &quot;&quot;
   
   if (A_ThisLabel = &quot;Str1&quot;)
      Run calc
   else if (A_ThisLabel = &quot;Str2&quot;)
      Run notepad
   return

#IfWinExist, Watch ahk_class AutoHotkeyGUI
Up::
Down::
   SetFont(&quot;cBlue&quot;, &quot;Text&quot; CurrentChoice)

   CurrentChoice += (A_ThisHotkey = &quot;Up&quot; ? -1 : 1)
   CurrentChoice := (CurrentChoice &gt; MaxChoice ? 1 : CurrentChoice = 0 ? MaxChoice : CurrentChoice)
   
   SetFont(&quot;cRed&quot;, &quot;Text&quot; CurrentChoice)
   return
   
Enter::
   PressEnter := 1
   goto, Str%CurrentChoice%
   return
   
SetFont(Options, Control)
{
   Gui, Font, % Options
   GuiControl, Font, % Control
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-02-20T22:26:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80226#p80226</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: OSD Remote menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=80224#p80224" />
			<content type="html"><![CDATA[<p>Просто убрать кнопки Radio и использовать вместо них Gui, Add, Text, cBlue gLaunchCalc, ...</p><p>Во втором варианте нет запуска по &lt;Enter&gt; и навигация невозможна с помощью клавиш &lt;Up&gt; &lt;Down&gt;, только с помощью кликов мыши, а надо клаву заюзать ... Естественно не теряя функционала первого скрипта ....</p><p>Возможно ли это сделать? Или можно использовать только кнопки Radio?</p>]]></content>
			<author>
				<name><![CDATA[Dr.Jekyll]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30028</uri>
			</author>
			<updated>2014-02-20T21:57:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=80224#p80224</id>
		</entry>
</feed>
