<?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]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=15762</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=15762&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Кастомный GUI».]]></description>
		<lastBuildDate>Wed, 06 Oct 2021 18:45:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=149946#p149946</link>
			<description><![CDATA[<p>Если не нужно, чтобы текст менялся вручную, нет смысла использовать тег input.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 06 Oct 2021 18:45:04 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=149946#p149946</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=149945#p149945</link>
			<description><![CDATA[<p><strong>teadrinker</strong> ой, извините.<br />А так я сделал<br /></p><div class="codebox"><pre><code> &lt;input type=&quot;text&quot; readonly&gt;</code></pre></div><p>И это работает, а другой вопрос я сам попробую решить.</p>]]></description>
			<author><![CDATA[null@example.com (~incognito)]]></author>
			<pubDate>Wed, 06 Oct 2021 18:40:31 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=149945#p149945</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=149944#p149944</link>
			<description><![CDATA[<p>Ваши вопросы не по тематике форума и поставлены некорректно. <em>+ReadOnly</em> и <em>GuiControl</em> используются для стандартных контролов, которые создаются через <em>Gui, Add, ...</em>, а для элементов html-страницы они неприменимы. Изучайте html/css/js, информации в сети предостаточно.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 06 Oct 2021 18:33:04 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=149944#p149944</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=149943#p149943</link>
			<description><![CDATA[<p>Появился вопрос связанный с этой темой, я сделал стиль для Gui и не понимаю:<br />1) Как добавить параметр +ReadOnly<br />2) Как использовать GuiControl<br />Мне нужно сделать так чтобы в Edit(input) менялся текст.<br /></p><div class="codebox"><pre><code>html =
(
&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;style&gt;
      * {
         margin: 0;
         padding: 0;
      }
      html {
         background: #270004;
      }
      input {
		width: 40px;
		height: 21px;
		margin: 10px 0 0 1px;
		padding: 5px;
		border: 1px;
		border-radius: 7px;
		font: 14px &quot;Calibri&quot;;
		background-color: #c8ffa9;
		color: #0008ff;
	}
	  #a {
    font-weight: bold;
    color: green;
    font-size: 20px;
    font-family: Calibri;
    display: inline;
    margin: 0px 0px 0px 14px;
}
	  #b {
    font-weight: bold;
    color: green;
    font-size: 20px;
    font-family: Calibri;
    margin: -28px 0px 0px 0px;
    display: inline;
}
      }
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
	&lt;p id=&quot;a&quot;&gt;До игрока:&lt;/p&gt;
    &lt;input type=&quot;text&quot;&gt;
	&lt;p id=&quot;b&quot;&gt;метров&lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;
)

Gui, -DPIScale
Gui, Margin, 0, 0
Gui, Add, ActiveX, w250 h60 vWB, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WB.document.write(html)
Gui, Show
WB.document.querySelector(&quot;input&quot;).focus()
Return

GuiClose:
   ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (~incognito)]]></author>
			<pubDate>Wed, 06 Oct 2021 18:16:59 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=149943#p149943</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143286#p143286</link>
			<description><![CDATA[<p>Спасибо всем кто помог разобраться с интеграцией html/css в ahk!</p><p>Прилагаю результат работы данной темы, может кому-то пригодится, будет легче с наглядным примером и поможет разобраться:<br />- замена текста, вызов кнопок, обработка форм, условия для старта, ограничения на ввод<br />- кнопки, формы, меню - меняют внешний вид при взаимодействии с пользователем<br />- вместо msgbox, новое окно в стилистике, пример ф-кция &quot;OnErr()&quot;</p><p>Экземпляр:<br />- на ctrl+5 выбираем активное окно меняя форму, заблокирована для действий с мышкой<br />- ввод числа с ограничением<br />- ctrl+1, замена текста на кнопку<br />- ctrl+2-4, замена текста на переменную, в данном случае на координаты мышки<br />- кнопка старт только после заполнения форм и областей, иначе покажет msgbox<br />- меню &quot;Египетский&quot; вызывает окно. Для примера, если вызвать после старта, покажет счетчик цикла и затраченное время на выполнение</p><p><a href="https://ibb.co/0jWz1tN"><span class="postimg"><img src="https://i.ibb.co/ynMxKST/Example-Custom-Gui.jpg" alt="https://i.ibb.co/ynMxKST/Example-Custom-Gui.jpg" /></span></a></p><div class="codebox"><pre><code>
#NoEnv
#include ForumFunction.ahk
CoordMode, mouse
SetWorkingDir %A_ScriptDir%

global Counts := &quot;&quot;
global ElapsedTime := &quot;&quot;
global ElapsedTime2 := &quot;&quot;
global ElapsedTime3 := &quot;&quot;
global ElapsedTime4 := &quot;&quot;

gamewin = 
posX1 := &quot;&quot;
posX2 := &quot;&quot;
posX3 := &quot;&quot;

Gui, Parent: New, ,Example Custom Gui
Gui, Parent: -DPIScale 
Gui, Parent: Margin, 0, 0
Gui, Parent: Add, ActiveX, w1080 h854 vWB, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WB.document.write(html)
WB.document.getElementById(&quot;myImage&quot;).src := StrReplace(A_ScriptDir . &quot;\images\bg.png&quot;, &quot;\&quot;, &quot;/&quot;)
WB.document.getElementById(&quot;start&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnStart&quot;))
WB.document.getElementById(&quot;bu1&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnBu1&quot;))
WB.document.getElementById(&quot;bu2&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnBu1&quot;))
WB.document.getElementById(&quot;te1&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnEgypt&quot;))
Gui, Parent: Show
Return

OnStart() {
	global WB
	global posX1
	global posY1
	global posX2
	global posY2
	global posX3
	global posY3
	global gamewin
	
	CountEnc := WB.document.getElementById(&quot;fc2&quot;).value
	if (CountEnc == &quot;&quot; || CountEnc &gt; 25 
	|| gamewin == &quot;&quot; || posX1 == &quot;&quot; || posX2 == &quot;&quot; || posX3 == &quot;&quot;)
	{
		OnErr()
	}
	else if (RegExMatch(CountEnc, &quot;[^0-9]&quot;))
	{
		OnErr()
	}
	else
	{
		Game(CountEnc, posX1, posY1, posX2, posY2, posX3, posY3)
	}
return
}

Game(CountEnc, posX1, posY1, posX2, posY2, posX3, posY3)
{
global gamewin
global Time := A_TickCount

IfWinExist, %gamewin%
{
	WinMinimize, Example Custom Gui
	WinActivate, %gamewin%
}
else
	ExitApp

loop, 100
{
	Counts +=1
	Tooltip, %Counts%
	sleep, 25
}
	
ElapsedTime := A_TickCount - Time
ElapsedTime2 := Floor(ElapsedTime / 1000) ; sec
ElapsedTime3 := Floor(ElapsedTime2 / 60) ; min
ElapsedTime4 := ElapsedTime2 - (ElapsedTime3 * 60)

Gui, Parent: Restore
Gui, Parent: +AlwaysOnTop
Gui, Parent: -AlwaysOnTop
return
}

^1::
	Reelect := &quot;&lt;button type=&#039;submit&#039; id=&#039;bb1&#039; class=&#039;btn reboot&#039;&gt;КНОПКА&lt;/button&gt;&quot;
	WB.document.getElementById(&quot;co1-1&quot;).innerHTML := Reelect
	WB.document.getElementById(&quot;bb1&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnErr&quot;))
return

^2::
   MouseGetPos, posX1, posY1
   WB.document.getElementById(&quot;co2-2&quot;).innerText := posX1 . &quot; , &quot; . posY1
return

^3::
   MouseGetPos, posX2, posY2
   WB.document.getElementById(&quot;co3-3&quot;).innerText := posX2 . &quot; , &quot; . posY2
return

^4::
   MouseGetPos, posX3, posY3
   WB.document.getElementById(&quot;co4-4&quot;).innerText := posX3 . &quot; , &quot; . posY3
return

^5::
	CurPID := DllCall(&quot;GetCurrentProcessId&quot;)
	WinGet, gamewin1, PID, A
	if (gamewin1 = CurPID) 
	{
		OnErr()
	}
	else
	{
	WinGetTitle, gamewin, A
	WB.document.getElementById(&quot;fc1&quot;).placeholder := gamewin
	}
return

GuiClose:
   ExitApp
   
F12::ExitApp
</code></pre></div><p>Подключить ForumFunction.ahk:<br /></p><div class="codebox"><pre><code>
html =
(
&lt;!DOCTYPE html&gt;
&lt;html&gt;
 &lt;head&gt;
  &lt;style&gt;
	html, body
	{
	margin: 0px;
	background-color: #afafaf;
	}

.bgded
{
	background-color: #9d9d9d;
	background-size: auto;
	background-repeat: no-repeat;
}
	
.menu
{
	position: absolute;
	margin: 0px;
	padding: 0px;
	width: 100`%;
}

#te1
{
	display: block;
	color: #FFFFFF;
	position: absolute;
	left: 470px;
	top: 48.71px;
}

#te4
{
	color: #FFFFFF;
	position: absolute;
	left: 170px;
	top: 222.71px;
}

#te5
{
	color: #FFFFFF;
	position: absolute;
	left: 800px;
	top: 222.71px;
}

h1 
{
	font-family: Raleway;
	font-weight: 600;
	font-size: 27px;
	margin: 0px; 
	outline: none; 
	padding: none;
}

h1:hover
{
	text-shadow:0 5px 25px black; 
	cursor: default;
}

#fh5co
{

}

.form-control
{
	position: absolute;
	text-align: center;
	outline: none;
}

#fc1
{
	height: 50px;
	width: 222.1px;
	left: 123.99px;
	top: 271px;	
	cursor: default;
}

#fc2
{
	height: 50px;
	width: 90px;
	left: 800px;
	top: 273px;
}

input
{
	font-family: Raleway;
	font-weight: 500;
	font-size: 24px;
	color: #FFFFFF;
	background: transparent;
	border: 1px solid #FFFFFF;
	border-radius: 5px;
	margin: 0;
	overflow: visible
	outline: none;
}

.form-control:hover
{
	border-color: #f87d01;
	color: #f87d01;
}

.form-control:focus
{
	border-color: #f87d01;
	color: #f87d01;
}

.form-group 
{
	position: absolute;
	margin: 0px;
	padding: 0px;
	width: 100`%;
}

::placeholder
{
	color: #FFFFFF;
}

:hover::-webkit-input-placeholder {color: #f87d01}
:hover::-moz-placeholder          {color: #f87d01}
:hover:-moz-placeholder           {color: #f87d01}
:hover:-ms-input-placeholder      {color: #f87d01}
:focus::-webkit-input-placeholder {color: transparent}
:focus::-moz-placeholder          {color: transparent}
:focus:-moz-placeholder           {color: transparent}
:focus:-ms-input-placeholder      {color: transparent}

.button1
	{
	position: absolute;
	top: 452px;
	left: 50px;
	}
	
.btn {
	display: inline-block;
	color: transparent;
	background-color: transparent;
	text-align: center;
	font-size: 18px;
	border-radius: 5px;
	width: 150px;
	height: 55px;
	box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.15);
	outline: none; 
	padding: none;
	border: 1px solid transparent;
	transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
 }

.bu1
{
	background-color: #061e37;
	color: #FFFFFF;
	font-family: Roboto;
	font-weight: normal;
}

.bu2
{
	background-color: #FFFFFF;
	color: #061e37;
	font-family: Raleway;
	font-weight: bold;
	position: absolute;
	left: 830px;
}

.reboot
{
	color: #FFFFFF;
	font-family: Raleway;
	font-weight: bold;
	width: 189.27px;
	height: 41.43px;
	font-size: 20.85px;
	border-color: #FFFFFF;
	position: relative;
	margin-top: -10px;
}

.start
{
	color: #237976;
	font-family: Raleway;
	font-weight: bold;
	position: absolute;
	left: 466px;
	top: 748px;
	font-size: 20.85px;
	border-color: #237976;
}

.start:hover 
{
	color: #FFFFFF;
    background-color: #237976;
	border-color: transparent;
}

.start:active 
{
	color: #FFFFFF;
    background-color: #237976;
	border-color: transparent;
}

.bu1:hover 
{
	color: #f87d01;
	background-color: #061e37;
	border-color: #046bff;
}

.bu1:active 
{
	color: #f87d01;
	background-color: #061e37;
	border-color: #046bff;
}

.bu2:hover 
{
	color: #f87d01;
	background-color: #FFFFFF;
	border-color: #f87d01;
}
 
.bu2:active 
{
	color: #f87d01;
	background-color: #FFFFFF;
	border-color: #f87d01;
}

.reboot:hover 
{
	color: #FFFFFF;
    background-color: #237976;
	border-color: transparent;
}
 
.reboot:active 
{
	color: #FFFFFF;
    background-color: #237976;
	border-color: transparent;
}

h2 
{
	font-family: Raleway;
	font-weight: 600;
	font-size: 24px;
	outline: none; 
	padding: none;
	margin: 0px;
}

.counts
{

}

.c1
{
	position: absolute;
	width: 270.03px;
	height: 101.25px;
	top: 595.84px;
	left: 0px;
	background-color: #80d8ff;
}

#co1
{
	position: relative;
	color: #000;
	text-align: center;
	margin: 15px;
	padding: 0px;
	border: 0px;
}

#co1-1
{
	position: relative;
	color: #FFFFFF;
	font-weight: 700;
	font-size: 30px;
	text-align: center;
	margin-top: -10px;
}

.c2
{
	position: absolute;
	width: 270.03px;
	height: 101.25px;
	top: 595.84px;
	left: 270.03px;
	background-color: #82b1ff;
}

#co2
{
	position: relative;
	color: #000;
	text-align: center;
	margin: 15px;
	padding: 0px;
	border: 0px;
}

#co2-2
{
	position: relative;
	color: #FFFFFF;
	font-weight: 700;
	font-size: 30px;
	text-align: center;
	margin-top: -10px;
}

.c3
{
	position: absolute;
	width: 270.03px;
	height: 101.25px;
	top: 595.84px;
	left: 540.06px;
	background-color: #b388ff;
}


#co3-3
{
	position: relative;
	color: #FFFFFF;
	font-weight: 700;
	font-size: 30px;
	text-align: center;
	margin-top: -10px;
}


.c4
{
	position: absolute;
	width: 270.03px;
	height: 101.25px;
	top: 595.84px;
	left: 810.09px;
	background-color: #ea80fc;
}


#co4-4
{
	position: relative;
	color: #FFFFFF;
	font-weight: 700;
	font-size: 30px;
	text-align: center;
	margin-top: -10px;
}

  &lt;/style&gt;
 &lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;bgded&quot; id=&quot;bgimg&quot;&gt; 
	&lt;div class=&quot;menu&quot;&gt;
	&lt;img id=&quot;myImage&quot;&gt;
	&lt;h1 id=&quot;te1&quot;&gt;Египетский&lt;/h1&gt;
	&lt;h1 id=&quot;te4&quot;&gt;Окно ctrl+5&lt;/h1&gt;
	&lt;h1 id=&quot;te5&quot;&gt;Число&lt;/h1&gt;
	&lt;/div&gt;
	&lt;form id=&quot;fh5co&quot;&gt;
		&lt;div class=&quot;form-group&quot;&gt;
            &lt;input type=&quot;text&quot; form=&quot;fh5co&quot; class=&quot;form-control&quot; id=&quot;fc1&quot; placeholder=&quot;Example&quot; disabled&gt;
			&lt;input type=&quot;text&quot; form=&quot;fh5co&quot; class=&quot;form-control&quot; id=&quot;fc2&quot; placeholder=&quot;10&quot; autocomplete=&quot;off&quot; max=&quot;25&quot; min=&quot;4&quot; maxlength=&quot;2&quot;&gt; 
        &lt;/div&gt;
		&lt;button type=&quot;submit&quot; class=&quot;btn start&quot; id=&quot;start&quot;&gt;СТАРТ&lt;/button&gt;
	&lt;/form&gt;
	&lt;div class=&quot;button1&quot;&gt;
	&lt;button type=&quot;button&quot; class=&quot;btn bu1&quot; id=&quot;bu1&quot;&gt;BUTTON&lt;/button&gt;
	&lt;button type=&quot;button&quot; class=&quot;btn bu2&quot; id=&quot;bu2&quot;&gt;BUTTON&lt;/button&gt;
	&lt;/div&gt;
	&lt;div class=&quot;counts&quot;&gt;
		&lt;div class=&quot;c1&quot;&gt;
		&lt;h2 id=&quot;co1&quot;&gt;Выбрать кнопку:&lt;/h2&gt;
		&lt;h2 id=&quot;co1-1&quot;&gt;ctrl + 1&lt;/h2&gt;
		&lt;/div&gt;
		&lt;div class=&quot;c2&quot;&gt;
		&lt;h2 id=&quot;co2&quot;&gt;Выбрать область 2:&lt;/h2&gt;
		&lt;h2 id=&quot;co2-2&quot;&gt;ctrl + 2&lt;/h2&gt;
		&lt;/div&gt;
		&lt;div class=&quot;c3&quot;&gt;
		&lt;h2 id=&quot;co2&quot;&gt;Выбрать область 3:&lt;/h2&gt;
		&lt;h2 id=&quot;co3-3&quot;&gt;ctrl + 3&lt;/h2&gt;		
		&lt;/div&gt;
		&lt;div class=&quot;c4&quot;&gt;
		&lt;h2 id=&quot;co2&quot;&gt;Выбрать область 4:&lt;/h2&gt;
		&lt;h2 id=&quot;co4-4&quot;&gt;ctrl + 4&lt;/h2&gt;		
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
)

OnEgypt() {

global WBEgypt

html =
(
&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;style&gt;
		.btn {
			display: inline-block;
			color: transparent;
			background-color: transparent;
			text-align: center;
			font-size: 18px;
			border-radius: 5px;
			width: 150px;
			height: 55px;
			box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.15);
			outline: none;
			padding: none;
			border: 1px solid transparent;
			transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
		}

		.Confirm
		{
			display: block;
			color: #237976;
			font-family: Raleway;
			font-weight: bold;
			position: relative;
			margin-left: auto;
			margin-right: auto;
			margin-top: 10`%;
			font-size: 20.85px;
			border-color: #237976;
		}

		.Confirm:hover 
		{
			color: #FFFFFF;
			background-color: #237976;
			border-color: transparent;
		}

		.Confirm:active 
		{
			color: #FFFFFF;
			background-color: #237976;
			border-color: transparent;
		}
		
		h1 
		{
			font-family: Raleway;
			font-weight: 600;
			font-size: 27px;
			margin: 25px; 
			outline: none; 
			padding: none;
		}
		
		.sText
		{
			text-align: left;
		}
		
		body
		{
			text-align: center;
		}
		
		html
		{
			width: 500px;
			height: 300px;
		}
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;h1&gt;Египетский&lt;/h1&gt;
		&lt;div class=&quot;sText&quot;&gt;
		&lt;h1 id=&quot;st&quot;&gt;&lt;/h1&gt;
		&lt;/div&gt;
		&lt;button type=&quot;button&quot; id=&quot;ex&quot; class=&quot;btn Confirm&quot;&gt;OK&lt;/button&gt;
	&lt;/body&gt;
&lt;/html&gt;
)

Gui, Egypt: New, , Египетский
Gui, Egypt: Margin, 0, 0
Gui, Egypt: Add, ActiveX, w500 h300 vWBEgypt, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WBEgypt.document.write(html)
WBEgypt.document.getElementById(&quot;ex&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnClose&quot;))
WBEgypt.document.getElementById(&quot;st&quot;).innerHTML := (&quot;Счетчик: &quot; . Counts &quot; &lt;br&gt; Время: &quot; . ElapsedTime3 . &quot; min, &quot; . ElapsedTime4 . &quot; sec&quot;)
Gui, Egypt: Show
return

EgyptGuiClose:
Gui, Destroy
return
}

OnErr() {

global WBErr

html =
(
&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;style&gt;
		.btn {
			display: inline-block;
			color: transparent;
			background-color: transparent;
			text-align: center;
			font-size: 18px;
			border-radius: 5px;
			width: 150px;
			height: 55px;
			box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.15);
			outline: none;
			padding: none;
			top: 50px;
			border: 1px solid transparent;
			transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
		}

		.Confirm
		{
			display: block;
			color: #237976;
			font-family: Raleway;
			font-weight: bold;
			position: relative;
			margin-left: auto;
			margin-right: auto;
			margin-top: 10`%;
			font-size: 20.85px;
			border-color: #237976;
		}

		.Confirm:hover 
		{
			color: #FFFFFF;
			background-color: #237976;
			border-color: transparent;
		}

		.Confirm:active 
		{
			color: #FFFFFF;
			background-color: #237976;
			border-color: transparent;
		}
		
		h1 
		{
			font-family: Raleway;
			font-weight: 600;
			font-size: 27px;
			margin: 25px; 
			outline: none; 
			padding: none;
			text-align: center;
		}
		
		.sText
		{
			text-align: left;
		}
		
		body
		{
			text-align: center;
		}
		
		html
		{
			width: 300px;
			height: 300px;
		}
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;h1&gt;Ошибка&lt;/h1&gt;
		&lt;div class=&quot;sText&quot;&gt;
		&lt;h1 id=&quot;li&quot;&gt;&lt;/h1&gt;
		&lt;h1&gt;
		Ошибка&lt;/h1&gt;
		&lt;/div&gt;
		&lt;button type=&quot;button&quot; id=&quot;ex&quot; class=&quot;btn Confirm&quot;&gt;OK&lt;/button&gt;
	&lt;/body&gt;
&lt;/html&gt;
)

Gui, Err: New, , Ошибка
Gui, Err: Margin, 0, 0
Gui, Err: Add, ActiveX, w300 h300 vWBErr, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WBErr.document.write(html)
WBErr.document.getElementById(&quot;ex&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnClose&quot;))
Gui, Err: Show
return

ErrGuiClose:
Gui, Destroy
return
}

OnBu1() {

global WBBu1

html =
(
&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;style&gt;
		.btn {
			display: inline-block;
			color: transparent;
			background-color: transparent;
			text-align: center;
			font-size: 18px;
			border-radius: 5px;
			width: 150px;
			height: 55px;
			box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.15);
			outline: none;
			padding: none;
			border: 1px solid transparent;
			transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
		}

		.Confirm
		{
			display: block;
			color: #237976;
			font-family: Raleway;
			font-weight: bold;
			position: relative;
			margin-left: auto;
			margin-right: auto;
			margin-top: 10`%;
			font-size: 20.85px;
			border-color: #237976;
		}

		.Confirm:hover 
		{
			color: #FFFFFF;
			background-color: #237976;
			border-color: transparent;
		}

		.Confirm:active 
		{
			color: #FFFFFF;
			background-color: #237976;
			border-color: transparent;
		}
		
		h1 
		{
			font-family: Raleway;
			font-weight: 600;
			font-size: 27px;
			margin: 25px; 
			outline: none; 
			padding: none;
			text-align: center;
		}
		
		.sText
		{
			text-align: left;
		}
		
		body
		{
			text-align: center;
		}
		
		html
		{
			width: 300px;
			height: 300px;
		}
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;h1&gt;BUTTON&lt;/h1&gt;
		&lt;div class=&quot;sText&quot;&gt;
		&lt;h1 id=&quot;li&quot;&gt;BUTTONS&lt;/h1&gt;
		&lt;/div&gt;
		&lt;button type=&quot;button&quot; id=&quot;ex&quot; class=&quot;btn Confirm&quot;&gt;OK&lt;/button&gt;
	&lt;/body&gt;
&lt;/html&gt;
)

Gui, Bu1: New, , Button
Gui, Bu1: Margin, 0, 0
Gui, Bu1: Add, ActiveX, w300 h300 vWBBu1, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WBBu1.document.write(html)
WBBu1.document.getElementById(&quot;ex&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnClose&quot;))
Gui, Bu1: Show
return

Bu1GuiClose:
Gui, Destroy
return
}

OnButton() {
   MsgBox, Hi
   return
}

OnReelect() {
	Msgbox, hi
	return
}

OnClose() {
	Gui Err: Destroy
	Gui Bu1: Destroy
	Gui Egypt: Destroy
	return
}
</code></pre></div><p>Картинку залить в папку images.</p>]]></description>
			<author><![CDATA[null@example.com (Botsy)]]></author>
			<pubDate>Fri, 06 Nov 2020 20:15:00 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143286#p143286</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143085#p143085</link>
			<description><![CDATA[<p>В общем фон так и не заработал вашим методом, решил по другому: убрал все что было связано с фоном, добавил обычное изображение в блок и уже ему указал относительный путь. <br />Обрезал код кусками, чтобы найти где же была ошибка. Наверное где-то в синтаксисе атрибута &quot;url&quot; для BG, потому что часть после StrReplace - рабочая.<br /></p><div class="quotebox"><blockquote><div class="codebox"><pre><code>
WB.document.querySelector(&quot;.bgded&quot;).style.backgroundImage := &quot;url(&quot; . StrReplace(A_ScriptDir . &quot;\images\bg.png&quot;, &quot;\&quot;, &quot;/&quot;) . &quot;)&quot; 
</code></pre></div></blockquote></div><div class="codebox"><pre><code>
SetWorkingDir %A_ScriptDir%

&lt;div class=&quot;bgded&quot; id=&quot;bgimg&quot;&gt; 
	&lt;div class=&quot;menu&quot;&gt;
	&lt;img id=&quot;myImage&quot;&gt;
	&lt;h1 id=&quot;te1&quot;&gt;Меню&lt;/h1&gt;
&lt;/div&gt;

WB.document.getElementById(&quot;myImage&quot;).src := StrReplace(A_ScriptDir . &quot;\images\bg.png&quot;, &quot;\&quot;, &quot;/&quot;)
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Botsy)]]></author>
			<pubDate>Mon, 02 Nov 2020 09:44:06 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143085#p143085</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143083#p143083</link>
			<description><![CDATA[<p>Если вы каждый раз создаёте новое окно, нужно Gui, Destroy.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 01 Nov 2020 21:16:04 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143083#p143083</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143082#p143082</link>
			<description><![CDATA[<p><strong>teadrinker</strong> Изменил переменную для activeX и все заработало. <br /></p><div class="codebox"><pre><code>
OnBuy() {

global WBB

html =
(
&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Testing Page&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;h1&gt;Example&lt;/h1&gt;
		&lt;button type=&quot;button&quot; id=&quot;ex&quot; class=&quot;btn reboot&quot;&gt;OK&lt;/button&gt;
	&lt;/body&gt;
&lt;/html&gt;
)

Gui, New
Gui, Margin, 0, 0
Gui, Add, ActiveX, w300 h150 vWBB, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WBB.document.write(html)
WBB.document.getElementById(&quot;ex&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnButton&quot;))
Gui, Show
return
}
</code></pre></div><p>Интересно, а зачем надо добавлять глобальную переменную в функцию для ActiveX, если мы используем этот компонент внутри функции ? Попробовал удалить этот global, без него не работало.</p><p>Можно ли как-то закрывать это окно(от ф-ции OnBuy) и не закрывать весь скрипт целиком ? В скрипте есть GuiClose<br /></p><div class="codebox"><pre><code>GuiClose:
   ExitApp</code></pre></div><p>UPD: дал второму окну метку &quot;ММ&quot; при вызове и закрываю его так:<br /></p><div class="codebox"><pre><code>
Gui, MM: New
Gui, MM: Show
return

MMGuiClose:
Gui, Cancel
return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Botsy)]]></author>
			<pubDate>Sun, 01 Nov 2020 17:31:19 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143082#p143082</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143081#p143081</link>
			<description><![CDATA[<p>Сейчас без компьютера, пока не могу попробовать. Но вижу, что у вас для обоих окон одна и та же переменная WB для ActiveX контролов, должны быть разные. И смотрите, как у меня создается контрол, у вас не так.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 01 Nov 2020 16:42:59 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143081#p143081</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143080#p143080</link>
			<description><![CDATA[<p>Хочу изменить дизайн стандартного MsgBox. Предположим, что это обычное окно с кнопкой. Значит это окно нужно вызывать функцией и еще одну функцию в качестве обработчика самой кнопки. </p><p>Сейчас нажав на элемент &quot;меню&quot;, появляется новое окно (Gui), но оно не воспринимает html оформление - просто пустое окно. <br />Не понимаю каким синтаксисом ahk заставить видеть html. Функция &quot;OnMenu&quot;, подскажите пж в чем проблема.</p><div class="codebox"><pre><code>
#NoEnv
CoordMode, mouse

html =
(
&lt;!DOCTYPE html&gt;
&lt;html&gt;
   &lt;head&gt;
      &lt;style&gt;
		html,
		body {
			margin: 0px;
		}

		.bgded {
			background-size: auto;
			background-repeat: no-repeat;
			height: 1080px;
			width: 1080px;
		}

		.menu {
			position: relative;
			margin: 20px;
		}

		.btn {
			display: inline-block;
			color: transparent;
			background-color: transparent;
			text-align: center;
			font-size: 18px;
			border-radius: 5px;
			width: 150px;
			height: 55px;
			box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.15);
			outline: none;
			padding: none;
			border: 1px solid transparent;
			transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
		}

		.reboot {
			color: #FFFFFF;
			font-family: Raleway;
			font-weight: bold;
			width: 189.27px;
			height: 41.43px;
			font-size: 20.85px;
			border-color: #FFFFFF;
			position: relative;
			margin-top: -10px;
		}

		.reboot:hover {
			color: #FFFFFF;
			background-color: #237976;
			border-color: transparent;
		}

		.reboot:active {
			color: #FFFFFF;
			background-color: #237976;
			border-color: transparent;
		}

		h1 {
			font-family: Raleway;
			font-weight: 600;
			font-size: 27px;
			margin: 0px;
			outline: none;
			padding: none;
		}

		h1:hover {
			text-shadow: 0 5px 25px black;
			cursor: default;
		}

		#te1 {
			color: #000;
			position: relative;
			text-align: center;
		}

		h2 {
			font-family: Raleway;
			font-weight: 600;
			font-size: 24px;
			outline: none;
			padding: none;
			margin: 0px;
		}

		.c1 {
			position: absolute;
			width: 270.03px;
			height: 101.25px;
			top: 595.84px;
			left: 0px;
			background-color: #80d8ff;
		}

		#co1 {
			position: relative;
			color: #000;
			text-align: center;
			margin: 15px;
			padding: 0px;
			border: 0px;
		}

		#co1-1 {
			position: relative;
			color: #FFFFFF;
			font-weight: 700;
			font-size: 30px;
			text-align: center;
			margin-top: -10px;
		}

		.c2 {
			position: absolute;
			width: 270.03px;
			height: 101.25px;
			top: 595.84px;
			left: 270.03px;
			background-color: #82b1ff;
		}

		#co2 {
			position: relative;
			color: #000;
			text-align: center;
			margin: 15px;
			padding: 0px;
			border: 0px;
		}

		#co2-2 {
			position: relative;
			color: #FFFFFF;
			font-weight: 700;
			font-size: 30px;
			text-align: center;
			margin-top: -10px;
		}

		.c3 {
			position: absolute;
			width: 270.03px;
			height: 101.25px;
			top: 595.84px;
			left: 540.06px;
			background-color: #b388ff;
		}

		.c4 {
			position: absolute;
			width: 270.03px;
			height: 101.25px;
			top: 595.84px;
			left: 810.09px;
			background-color: #ea80fc;
		}
      &lt;/style&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;div class=&quot;bgded&quot;&gt;
         &lt;div class=&quot;menu&quot;&gt;
            &lt;h1 id=&quot;te1&quot;&gt;Меню&lt;/h1&gt;
         &lt;/div&gt;
         &lt;div class=&quot;counts&quot;&gt;
            &lt;div class=&quot;c1&quot;&gt;
               &lt;h2 id=&quot;co1&quot;&gt;Выбрать область:&lt;/h2&gt;
               &lt;h2 id=&quot;co1-1&quot;&gt;F9&lt;/h2&gt;
            &lt;/div&gt;
            &lt;div class=&quot;c2&quot;&gt;
               &lt;h2 id=&quot;co2&quot;&gt;Нажать:&lt;/h2&gt;
               &lt;h2 id=&quot;co2-2&quot;&gt;F10&lt;/h2&gt;
            &lt;/div&gt;
            &lt;div class=&quot;c3&quot;&gt;
            &lt;/div&gt;
            &lt;div class=&quot;c4&quot;&gt;
            &lt;/div&gt;
         &lt;/div&gt;
      &lt;/div&gt;
   &lt;/body&gt;
&lt;/html&gt;
)

Gui, -DPIScale
Gui, Margin, 0, 0
Gui, Add, ActiveX, w1080 h1080 vWB, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WB.document.write(html)
WB.document.querySelector(&quot;button&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnButton&quot;))
WB.document.getElementById(&quot;te1&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnMenu&quot;))
Gui, Show
WB.document.querySelector(&quot;input&quot;).focus()
Return

F9::
	x := &quot;&lt;button type=&#039;button&#039; class=&#039;btn reboot&#039;&gt;ПЕРЕВЫБРАТЬ&lt;/button&gt;&quot;
	WB.document.getElementById(&quot;co1-1&quot;).innerHTML := x
return

F10::
	MouseGetPos, posX, posY
	WB.document.getElementById(&quot;co2-2&quot;).innerText := posX . &quot; , &quot; . posY
return

OnButton() {
   MsgBox, Hi
}

OnMenu() {

global WB

html =
(
&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Page Title&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;h1&gt;This is a Heading&lt;/h1&gt;
		&lt;p&gt;This is a paragraph.&lt;/p&gt;
        &lt;button type=&quot;button&quot; class=&quot;btn reboot&quot;&gt;OK&lt;/button&gt;
	&lt;/body&gt;
&lt;/html&gt;
)

Gui, New
Gui, Margin, 0, 0
Gui, Add, ActiveX, w325 h150 vWB, Shell.Explorer
WB.document.write(html)
Gui, Show
return

}

GuiClose:
   ExitApp
</code></pre></div><p><a href="https://imgbb.com/"><span class="postimg"><img src="https://i.ibb.co/LJdBRpN/send1.png" alt="https://i.ibb.co/LJdBRpN/send1.png" /></span></a></p>]]></description>
			<author><![CDATA[null@example.com (Botsy)]]></author>
			<pubDate>Sun, 01 Nov 2020 16:17:49 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143080#p143080</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143064#p143064</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><div class="codebox"><pre><code>F9::
   MouseGetPos, posX, posY
   WB.document.getElementById(&quot;co2-2&quot;).innerText := posX . &quot;  &quot; . posY
return</code></pre></div></blockquote></div><p>Вот это топчик, спасибо!<br />А с фоном все равно не работает, буду разбираться в чем проблема.</p>]]></description>
			<author><![CDATA[null@example.com (Botsy)]]></author>
			<pubDate>Sat, 31 Oct 2020 19:39:14 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143064#p143064</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143025#p143025</link>
			<description><![CDATA[<p>С папкой проще можно:<br /></p><div class="codebox"><pre><code>WB.document.write(html)
WB.document.querySelector(&quot;.bgded&quot;).style.backgroundImage := &quot;url(&quot; . StrReplace(A_ScriptDir . &quot;\images\bg.png&quot;, &quot;\&quot;, &quot;/&quot;) . &quot;)&quot; </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 30 Oct 2020 20:40:30 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143025#p143025</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143024#p143024</link>
			<description><![CDATA[<div class="quotebox"><cite>Botsy пишет:</cite><blockquote><p>Запускаю, все работает, кроме фона.</p></blockquote></div><p>Обновите AHK, текущая версия 1.1.33.2.<br /></p><div class="codebox"><pre><code>F9::
   MouseGetPos, posX, posY
   WB.document.getElementById(&quot;co2-2&quot;).innerText := posX . &quot;  &quot; . posY
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 30 Oct 2020 20:23:49 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143024#p143024</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143021#p143021</link>
			<description><![CDATA[<p>Скопировал ваш код -&gt; в папке скрипт + папка images (в этой папке BG.png). Запускаю, все работает, кроме фона.</p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Какого текста, какие координаты?</p></blockquote></div><p> Если запустить скрипт выше, и нажать F9, то будет msgbox с координатами курсора. А как выводить эти координаты вместо надписи &quot;ctrl + 2&quot;. То есть, мы нажали F9, и надпись ctrl + 2 заменилась на надпись с этими координатами, как на скринах выше.</p>]]></description>
			<author><![CDATA[null@example.com (Botsy)]]></author>
			<pubDate>Fri, 30 Oct 2020 19:36:49 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143021#p143021</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Кастомный GUI]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=143020#p143020</link>
			<description><![CDATA[<div class="quotebox"><cite>Botsy пишет:</cite><blockquote><p>почему-то не работает.</p></blockquote></div><p>Папка images должна быть в директории скрипта, и проверьте правильность названий файла и папки.</p><div class="quotebox"><cite>Botsy пишет:</cite><blockquote><p>А как можно сделать, чтобы после нажатия &quot;ctrl + 2&quot;, вместо этого же текста, выводились координаты ?</p></blockquote></div><p>Честно, ничего не понял. Какого текста, какие координаты?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 30 Oct 2020 19:25:16 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=143020#p143020</guid>
		</item>
	</channel>
</rss>
