<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=13945</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=13945&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Gui, Add, Hotkey, Как поставить свою кнопку.».]]></description>
		<lastBuildDate>Thu, 19 Jul 2018 16:34:49 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127164#p127164</link>
			<description><![CDATA[<p>Здравствуйте!<br />Одна тема = один вопрос.<br />Если Вы будете всё, что Вас интересует, задавать в одной теме, то следует переименовать тему в &quot;Беседа с DaGer&quot; и придётся разбираться с дяденькой модератором.</p><p><em>SplashImage</em> - окно, не картинка. Лучше опишите цель, возможно, что есть другие способы её достичь.</p><p>И, пожалуйста, пользуйтесь знаками препинания. Они такие же участники в передаче смысла, как и слова:<br /></p><div class="quotebox"><blockquote><p>... и что можно придумать в место&nbsp; Sleepa к примеру активация на кнопку кнопки окно появляется и закрывается</p></blockquote></div><p>Ничего не понятно из словосочетания(казнить нельзя помиловать).</p>]]></description>
			<author><![CDATA[null@example.com (KusochekDobra)]]></author>
			<pubDate>Thu, 19 Jul 2018 16:34:49 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127164#p127164</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127163#p127163</link>
			<description><![CDATA[<div class="codebox"><pre><code>
   SplashImage,, y450 x800 w100 h50 ,, 
   Sleep 8000
</code></pre></div><p>Люди добрые подскажите, как поставить в окошко это картинку, как сделать чтобы мышкой нельзя было нажимать, игнорировать случайное нажатие на нее, и что можно придумать в место&nbsp; Sleepa к примеру активация на кнопку кнопки окно появляется и закрывается</p>]]></description>
			<author><![CDATA[null@example.com (DaGer)]]></author>
			<pubDate>Thu, 19 Jul 2018 15:40:41 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127163#p127163</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127162#p127162</link>
			<description><![CDATA[<p><strong>qqlexa</strong> Не нужно это, я просто код с черновика скопировал для примера</p>]]></description>
			<author><![CDATA[null@example.com (DaGer)]]></author>
			<pubDate>Thu, 19 Jul 2018 15:22:00 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127162#p127162</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127161#p127161</link>
			<description><![CDATA[<div class="quotebox"><cite>qqlexa пишет:</cite><blockquote><p>serzh82saratov, всё понятно кроме этого:</p></blockquote></div><p>ТС точно знает зачем, но никому не рассказывает.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 19 Jul 2018 14:44:55 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127161#p127161</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127159#p127159</link>
			<description><![CDATA[<p>Ооо Спасибо большое</p>]]></description>
			<author><![CDATA[null@example.com (DaGer)]]></author>
			<pubDate>Thu, 19 Jul 2018 14:12:44 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127159#p127159</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127158#p127158</link>
			<description><![CDATA[<p><strong>serzh82saratov</strong>, всё понятно кроме этого:<br /></p><div class="codebox"><pre><code>
Key1:
	Loop 1 ; Зачем это
	{
		if not GetKeyState(&quot;Key1&quot; &quot;P&quot;) ; Что и зачем это
			SendInput, {1}{2}{3}{4}{5}
	}
	return

Key2:
	Loop 1 ; Зачем это
	{
		if not GetKeyState(&quot;Key2&quot; &quot;P&quot;) ; Что и зачем это
			SendInput, Всем привет!
	}
	return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (qqlexa)]]></author>
			<pubDate>Thu, 19 Jul 2018 14:11:00 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127158#p127158</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127157#p127157</link>
			<description><![CDATA[<p>Так проще?<br /></p><div class="codebox"><pre><code>
#UseHook
IniRead, Key1, IniFile.ini, Section, Key1, % A_Space
IniRead, Key2, IniFile.ini, Section, Key2, % A_Space 

Gui, Add, Hotkey, x12 y9 w90 h30 vKey1, % Key1
Gui, Add, Hotkey, x12 y49 w90 h30 vKey2, % Key2

Gui, Add, Button, x112 y9 w30 h30 gButton1, Button
Gui, Add, Button, x112 y49 w30 h30 gButton2, Button
Gui, Show, w157 h96, Untitled GUI
return

Button1:
	Gui, Submit, NoHide
	Hotkey, % PrKey1, off, UseErrorLevel
	Hotkey, % PrKey1 := Key1, Key1, on, UseErrorLevel
	IniWrite, % Key1, IniFile.ini, Section, Key1
	return

Button2:
	Gui, Submit, NoHide
	Hotkey, % PrKey2, off, UseErrorLevel
	Hotkey, % PrKey2 := Key2, Key2, on, UseErrorLevel
	IniWrite, % Key1, IniFile.ini, Section, Key2
	return 
	
Key1:
	Loop 1
	{
		if not GetKeyState(&quot;Key1&quot; &quot;P&quot;)
			SendInput, {1}{2}{3}{4}{5}
	}
	return

Key2:
	Loop 1
	{
		if not GetKeyState(&quot;Key2&quot; &quot;P&quot;)
			SendInput, Всем привет!
	}
	return

GuiClose:
	ExitApp
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 19 Jul 2018 13:59:10 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127157#p127157</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127154#p127154</link>
			<description><![CDATA[<p>Как сделать статичные кнопки я разобрался,) спасибо, буду ждать тогда.<br />Мне пример исходник главное, как нибудь разберусь.</p>]]></description>
			<author><![CDATA[null@example.com (DaGer)]]></author>
			<pubDate>Thu, 19 Jul 2018 12:01:46 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127154#p127154</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127153#p127153</link>
			<description><![CDATA[<p>Вот,&nbsp; попробуй простой пример. <br /></p><div class="codebox"><pre><code>Hotkey, F1, Key1
Hotkey, F2, Key2
return
Key1:
SendInput, 12345
return

Key2: 
SendInput, Всем привет!
return
</code></pre></div><p>Примеры скриптов выше,&nbsp; сложные для понимания новичкам и я думаю что стоит написать попроще примеры. Будет доступ к ПК - сделаю.</p>]]></description>
			<author><![CDATA[null@example.com (qqlexa)]]></author>
			<pubDate>Thu, 19 Jul 2018 11:13:34 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127153#p127153</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127152#p127152</link>
			<description><![CDATA[<div class="codebox"><pre><code>
Key1:
SendInput, 12345
return

Key2: 
SendInput, Всем привет!
return
</code></pre></div><p>Я и так делал не работает, за <strong>Suspend</strong> спасибо</p>]]></description>
			<author><![CDATA[null@example.com (DaGer)]]></author>
			<pubDate>Thu, 19 Jul 2018 10:40:53 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127152#p127152</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127151#p127151</link>
			<description><![CDATA[<p>Вот код для горячих клавиш: <br /></p><div class="codebox"><pre><code>Key1:
SendInput, 12345
return

Key2: 
SendInput, Всем привет!
return
</code></pre></div><p>Чтобы прекратить работу скрипта используйте <strong><span class="bbu"><em>ExitApp</em></span></strong>. <br />Для остановки/включения работы горячих клавиш <em><strong><span class="bbu">Suspend</span></strong></em>.</p>]]></description>
			<author><![CDATA[null@example.com (qqlexa)]]></author>
			<pubDate>Thu, 19 Jul 2018 10:01:56 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127151#p127151</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127150#p127150</link>
			<description><![CDATA[<p><strong>qqlexa</strong> Поэтому и спрашиваю как можно сделать правильно, покажите на примере моего скрипта чтобы на одну кнопку считал от 1 до 5 а на другую кнопку писал предложение &quot;Всем привет!&quot; и как сделать чтобы выбранную кнопку можно было подтверждать. Спасибо заранее.<br />И еще один вопрос. Как можно сделать чтобы определенный скрипт выключать или отключать, как те же трейнеры отключают и включают скрипт не сворачивая игру определенной кнопкой.</p>]]></description>
			<author><![CDATA[null@example.com (DaGer)]]></author>
			<pubDate>Thu, 19 Jul 2018 09:12:30 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127150#p127150</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127149#p127149</link>
			<description><![CDATA[<p><strong>DaGer</strong>,&nbsp; Нет доступа к ПК,&nbsp; поэтому сделаю замечания на код который может вызвать проблемы в работе скрипта. <br />Две метки с одинаковым названием: <br /></p><div class="codebox"><pre><code>
Gui, Add, Button, x112 y9 w30 h30 , Button
Gui, Add, Button, x112 y49 w30 h30 , Button
Gui, Show, w157 h96, Untitled GUI

return
GuiClose:
ExitApp

Button:
Gui, Submit, NoHide
Hotkey, Key1, Hotkey
return

Button:
Gui, Submit, NoHide
Hotkey, Key2, Hotkey
return
</code></pre></div><p>Бесполезные проверки в метках: <br /></p><div class="codebox"><pre><code>
Key1:
Loop 1
{
if not GetKeyState(&quot;Key1&quot; &quot;P&quot;)
SendInput, {1}{2}{3}{4}{5}
}
return

Key2:
Loop 1
{
if not GetKeyState(&quot;Key2&quot; &quot;P&quot;)
SendInput, Всем привет!
}
return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (qqlexa)]]></author>
			<pubDate>Thu, 19 Jul 2018 09:05:08 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127149#p127149</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127146#p127146</link>
			<description><![CDATA[<p>Спасибо большое, а как теперь привязать действие к кнопке чтобы он например считал или писал предложение, и как применять через Button?</p><div class="codebox"><pre><code>
IniRead, Key, IniFile.ini, Section, Key1, % A_Space
IniRead, Key, IniFile.ini, Section, Key2, % A_Space

Hotkey, % PrKey %A_DefaultGui% Key1 := Key, Action, On, UseErrorLevel
Hotkey, % PrKey %A_DefaultGui% Key2 := Key, Action, On, UseErrorLevel

Gui, Add, Hotkey, x12 y9 w90 h30 vKey1 gSave, % Key
Gui, Add, Hotkey, x12 y49 w90 h30 vKey2 gSave, % Key

Gui, Add, Button, x112 y9 w30 h30 , Button
Gui, Add, Button, x112 y49 w30 h30 , Button
Gui, Show, w157 h96, Untitled GUI

return
GuiClose:
ExitApp

Button:
Gui, Submit, NoHide
Hotkey, Key1, Hotkey
return

Button:
Gui, Submit, NoHide
Hotkey, Key2, Hotkey
return


Save:
Hotkey, % PrKey %A_Gui% %A_GuiControl%, off, UseErrorLevel
GuiControlGet, key, %A_Gui%:, %A_GuiControl%
Hotkey, % PrKey %A_Gui% %A_GuiControl% := key, Action, on, UseErrorLevel
IniWrite, % key, IniFile.ini, Section, % A_GuiControl
return

Key1:
Loop 1
{
if not GetKeyState(&quot;Key1&quot; &quot;P&quot;)
SendInput, {1}{2}{3}{4}{5}
}
return

Key2:
Loop 1
{
if not GetKeyState(&quot;Key2&quot; &quot;P&quot;)
SendInput, Всем привет!
}
return


</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DaGer)]]></author>
			<pubDate>Thu, 19 Jul 2018 05:26:30 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127146#p127146</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Gui, Add, Hotkey, Как поставить свою кнопку.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=127145#p127145</link>
			<description><![CDATA[<p>Много контролов и окон, обработка повторов.<br /></p><div class="codebox"><pre><code>

#SingleInstance Force
#NoEnv 

Loop 5
{
	GuiName := &quot;Gui&quot; A_Index 
	Gui, %GuiName%:+AlwaysOnTop -DPIScale +LabelGui
	
	Loop 15
	{
		IniRead, Key, IniFile.ini, Section, %GuiName%MyHotkey%A_Index%, % A_Space 
		func := Func(&quot;Action&quot;).Bind(GuiName, &quot;MyHotkey&quot; A_Index)
		Hotkey, % Arr()[GuiName &quot;MyHotkey&quot; A_Index] := Key, % func, On, UseErrorLevel 
		Gui, %GuiName%:Add, Text, +0x201 xm w20, % A_Index &quot;:&quot;
		Gui, %GuiName%:Add, Hotkey, vMyHotkey%A_Index% x+5 w200 gCheck, % Key   
	}
	Gui, %GuiName%:Show, % &quot;x&quot; 150 + 300 * (A_Index - 1), %GuiName%
}
Return

Check() {   
    Hotkey, % Arr()[A_Gui A_GuiControl], Off, UseErrorLevel
	func := Func(&quot;Action&quot;).Bind(A_Gui, A_GuiControl) 
    Hotkey, % Arr()[A_Gui A_GuiControl] := %A_GuiControl%, % func, On, UseErrorLevel
	IniWrite, % %A_GuiControl%, IniFile.ini, Section, % A_Gui A_GuiControl
}

Action(gui, name) {
	Static ThisPID := DllCall(&quot;GetCurrentProcessId&quot;)
	If WinActive(&quot;ahk_class AutoHotkeyGUI ahk_pid&quot; ThisPID)  
	{
		ToolTip % &quot;Уже назначено для:`n`n&quot; gui &quot;`n`n&quot; name, 5, 5 
		SetTimer, ToolTipHide, -550
		Return
	}
    MsgBox, 262208, Hotkey,% A_ThisHotkey &quot;`n`n&quot; gui &quot;`n`n&quot; name, 0.5
}

Arr() {
	Static Arr := {}
	Return Arr
}

ToolTipHide:
	ToolTip
	Return

GuiClose:
	ExitApp
</code></pre></div><br /><br /><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;Простой пример с 2 окнами.</div><div class="fancy_spoiler"><div class="codebox"><pre><code>
#SingleInstance Force
#NoEnv
  
Gui, New
Gui, +HWNDhGui1 +AlwaysOnTop

Loop % 15
{
	IniRead, Key, IniFile.ini, Section, Gui1MyHotkey%A_Index%, % A_Space
	func := Func(&quot;Action&quot;).Bind(&quot;Gui1&quot;, &quot;Gui1MyHotkey&quot; A_Index)
	Hotkey, % PrKeyGui1MyHotkey%A_Index% := Key, % func, On, UseErrorLevel
	Gui, Add, Hotkey, vMyHotkey%A_Index% gGui1, % Key
}
Gui, Show, x333

Gui, New
Gui, +HWNDhGui2 +AlwaysOnTop

Loop % 12
{
	IniRead, Key, IniFile.ini, Section, Gui2MyHotkey%A_Index%, % A_Space
	func := Func(&quot;Action&quot;).Bind(&quot;Gui2&quot;, &quot;Gui2MyHotkey&quot; A_Index)
	Hotkey, % PrKeyGui2MyHotkey%A_Index% := Key, % func, On, UseErrorLevel
	Gui, Add, Hotkey, vMyHotkey%A_Index% gGui2, % Key
}
Gui, Show, x666
Return

Gui1:
Gui2:
    Hotkey, % PrKey%A_ThisLabel%%A_GuiControl%, Off, UseErrorLevel
	
	func := Func(&quot;Action&quot;).Bind(A_ThisLabel, A_GuiControl)
	GuiControlGet, Key, %A_Gui%:, %A_GuiControl%
    Hotkey, % PrKey%A_ThisLabel%%A_GuiControl% := Key, % func, On, UseErrorLevel
	
	IniWrite, % Key, IniFile.ini, Section, %A_ThisLabel%%A_GuiControl%
    Return

Action(gui, name) {
	Global hGui1, hGui2
	If WinActive(&quot;ahk_id&quot; hGui1) || WinActive(&quot;ahk_id&quot; hGui2)
	{
		ToolTip Уже назначено, 5, 5
		SetTimer, ToolTipHide, -350
		Return
	}
    MsgBox,,, % A_ThisHotkey &quot;`n`n&quot; gui &quot;`n`n&quot; name, 0.5
}

ToolTipHide:
	ToolTip
	Return
</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 19 Jul 2018 00:32:25 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=127145#p127145</guid>
		</item>
	</channel>
</rss>
