<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13011&amp;type=atom" />
	<updated>2017-09-25T09:56:23Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13011</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119561#p119561" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Raven пишет:</cite><blockquote><p>Дело в том что (как я понял), в AHK ВСЕ данные хранятся в виде string. А мне нужно было именно числа.</p></blockquote></div><p>Так это хранятся (в переменных). Передаются-то они так, как вы укажете. Или думаете, что АНК делает исключение лично для вас, из вредности?</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2017-09-25T09:56:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119561#p119561</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119558#p119558" />
			<content type="html"><![CDATA[<p><strong>YMP</strong> Эта функция связи с контроллером. Посмотрел напрямую в контроллере. Дело в том что (как я понял), в AHK ВСЕ данные хранятся в виде string. А мне нужно было именно числа.<br /><strong>Alectric</strong> Плохо я читал вашу тему)) То что нужно. Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Raven]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30150</uri>
			</author>
			<updated>2017-09-25T09:02:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119558#p119558</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119501#p119501" />
			<content type="html"><![CDATA[<p>5) Как всегда ссылаюсь на свою <a href="http://forum.script-coding.com/viewtopic.php?id=12662">старую тему</a>:<br /></p><div class="codebox"><pre><code>      ; данные для отправки
      b_0=0          ; 1 байт
      b_1++          ; 1 байт
      b_2=255        ; 1 байт
      w_0=1234567890 ; 4 байта
      b_3=128        ; 1 байт

      varsetcapacity(Out_Data,Send_Data_Size) ; задаём размер переменной для отправки
      NumPut(b_0,Out_Data,0,&quot;Uchar&quot;)          ; 1 байт
      NumPut(b_1,Out_Data,1,&quot;Uchar&quot;)          ; 1 байт
      NumPut(b_2,Out_Data,2,&quot;Uchar&quot;)          ; 1 байт
      NumPut(w_0,Out_Data,3,&quot;Uint&quot;)           ; 4 байта
      NumPut(b_3,Out_Data,7,&quot;Uchar&quot;)          ; 1 байт
                                              ; остальные байты резервные

      ; пишем данные в порт
      RS232_Write(RS232_FileHandle,&amp;Out_Data,Send_Data_Size)
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2017-09-22T16:23:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119501#p119501</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119491#p119491" />
			<content type="html"><![CDATA[<p>Как вы это посмотрели? Если речь о том, что пишет функция Cli_DBWrite, то к ней и вопрос. Наверно, она преобразует число в строковый вид.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2017-09-22T11:44:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119491#p119491</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119487#p119487" />
			<content type="html"><![CDATA[<p><strong>YMP</strong> Дело в том что как раз оно и отправляется, но только как символ &quot;1&quot; а не как число. То есть в формате Сhar, а должно быть в Int.</p>]]></content>
			<author>
				<name><![CDATA[Raven]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30150</uri>
			</author>
			<updated>2017-09-22T08:30:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119487#p119487</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119486#p119486" />
			<content type="html"><![CDATA[<p>Всё нормально у вас должно отправляться.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2017-09-22T07:54:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119486#p119486</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119483#p119483" />
			<content type="html"><![CDATA[<p>А кто подскажет насчет пятого вопроса?<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p>Ну и последний вопрос, как правильно отправлять числа в DllCall? Именно числа. У меня отправляются символы. Вместо 1 отправляется 49, что является кодом числа 1 в ASCII.<br /></p><div class="codebox"><pre><code>WriteDB(obj, db, start, size, data){
	SetFormat,Integer,DEC
	DllCall(&quot;snap7.dll\Cli_DBWrite&quot;, &quot;Ptr&quot;, obj, &quot;Int&quot;, db, &quot;int&quot;, start, &quot;int&quot;, size, &quot;ptr&quot;, &amp;data) 
	return
}</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[Raven]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30150</uri>
			</author>
			<updated>2017-09-22T05:46:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119483#p119483</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119465#p119465" />
			<content type="html"><![CDATA[<p>В методах классов я не разбираюсь. Вот пример с кнопкой, при нажатии по кнопке выводится информация о ней . Аналогично можно вывести информацию о картинке.<br /></p><div class="codebox"><pre><code>GUI, Add, Button, w50 h50 gSub, KNOPKA1
GUI, Add, Button, w100 h100 gSub vKNOPKA2
GUI, Show ; , w100 h100
Return

Sub:
ToolTip,  %A_GuiControlEvent%`n %A_GuiControl%
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2017-09-21T14:01:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119465#p119465</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119452#p119452" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong> Спасибо за ссылку. Мне это подходит. <br />По второму вопросу, видимо я неправильно выразился, мне нужно просто перетаскивать контролы по GUI окну. Не нужно кидать файлы на GUI.<br />Третье, в классе есть картинка. По клику на этой картинке можно вызвать метод класса. Вот как так сделать что бы этот метод вызывал еще одно окошко и в этом окошке было отображение данных данного объекта?</p>]]></content>
			<author>
				<name><![CDATA[Raven]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30150</uri>
			</author>
			<updated>2017-09-21T05:24:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119452#p119452</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119428#p119428" />
			<content type="html"><![CDATA[<p>По вопросу №1: <a href="http://forum.script-coding.com/viewtopic.php?pid=46934#p46934">http://forum.script-coding.com/viewtopi … 934#p46934</a>.</p><p>По вопросу №2: действуйте согласно справке, там написано.<br /></p><div class="codebox"><pre><code>GUI, Add, Button, w50 h50, KNOPKA1
GUI, Add, Button, w100 h100 vKNOPKA2, 
GUI, Show ; , w100 h100
Return

GuiDropFiles:
MsgBox, Вы перетащили %A_GuiControlEvent%`nна элемент управления %A_GuiControl%
Return</code></pre></div><br /><p>По вопросу №3: что значит <span class="bbu">по клику на картинку класса</span>?</p><p>По вопросу №4: стандартных способов вроде нет, см. GDI plus.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2017-09-20T14:07:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119428#p119428</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119427#p119427" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong> Будут параллельны рамкам окна и можно одинакового цвета.</p>]]></content>
			<author>
				<name><![CDATA[Raven]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30150</uri>
			</author>
			<updated>2017-09-20T13:55:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119427#p119427</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119426#p119426" />
			<content type="html"><![CDATA[<p>По вопросу №1. Линии и прямоугольники будут одинакового цвета? Будут ли они параллельны рамкам окна, или могут идти по диагонали?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2017-09-20T13:49:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119426#p119426</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK:GUI, DllCall и еще кое-какие вопросы...]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=119418#p119418" />
			<content type="html"><![CDATA[<p>Добрый день, форумчане. Накопилось множество вопросов на которые я не нашел ответы на нашем (да и на забугорном) форуме.<br />1) Как в GUI&nbsp; нарисовать линии? Требуется рисовать линии в Gui, в котором содержатся кнопки, картинки, прогресбары и т.д. То есть мне требуется на ряду с обычными элементами Gui, рисовать и линии или прямоугольники.<br />2) Можно ли сделать регистрацию drag and drop по картинке? То есть таскать картинку (Да и вообще любой контрол.) в Gui мышкой?<br />3) Как можно отображать данные объекта во всплывающем окне по клику на картинку (Gui элемент) класса? Как только я не мучался, и в классе инициализировал второе окно, и в начале скрипта, ничего не получается.<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>;Инициализацию второго ГУИ я делал в начале скрипта.
class Valve{
  x:=0, y:=0, db:=0
  __New(x,y,name){
    this.name:=name 
    this.x:=x
    this.y:=y
    Gui, Add, Picture, w30 h-1 x%x% y%y% BackgroundTrans gValve.TEST hwndV1, C:\Users\vic\Pictures\Val-Grey.emf
    this.V1:=V1
    x2:=x+30
    y2:=y+25
    gui, add, text, x%x2% y%y2% hwnddbg, text000
    this.dbg:=dbg
    x3:=x+30
    y3:=y+0
    gui, add, text, x%x3% y%y3% cRed hwndMan, te
    this.Man:=Man
  }
  update(db){
    this.db:=db
    GuiControl,, % this.dbg, % this.name
    if (db==0)
    GuiControl,, % this.V1, C:\Users\vic\Pictures\Val-Grey.emf
    else if (db==1) or (db==5)
    GuiControl,, % this.V1, C:\Users\vic\Pictures\Val-Green.emf
    else if (db==2) or (db==6)
    GuiControl,, % this.V1, C:\Users\vic\Pictures\Val-Red.emf
    else if (TicTak==1) and ((db==3) or (db==7)) 
    GuiControl,, % this.V1, C:\Users\vic\Pictures\Val-Green.emf
    Else if (TicTak==0) and ((db==3) or (db==7))
    GuiControl,, % this.V1, C:\Users\vic\Pictures\Val-Grey.emf
    else if (TicTak==1) and ((db==4) or (db==8))
    GuiControl,, % this.V1, C:\Users\vic\Pictures\Val-Red.emf
    else if (TicTak==0) and ((db==4) or (db==8))
    GuiControl,, % this.V1, C:\Users\vic\Pictures\Val-Grey.emf

    GuiControl,2:, % this.TT1, % db

    if (db=5) or (db=6) or (db=7) or (db=8)
    GuiControl,, % this.Man, M
    else GuiControl,, % this.Man, 

  }
  ;тестирование открытия окна по клику на клапан. Открываться должны с данными клапана.
  ;какие только варианты не были испробованы... 
  TEST() {
    ;gui, 2:Submit
    ;Gui, 2:add, text,hwndTT1, text
    ;this.TT1:=TT1
    ;GuiControl,2:, % this.TT1, % db
    ;this.TEST:=TEST
    gui, 2:show, h100 w100
    
  }
}</code></pre></div></div></div><p>4) Можно ли как то перевернуть картинку на 90 градусов? <br />5) Ну и последний вопрос, как правильно отправлять числа в DllCall? Именно числа. У меня отправляются символы. Вместо 1 отправляется 49, что является кодом числа 1 в ASCII.<br /></p><div class="codebox"><pre><code>WriteDB(obj, db, start, size, data){
	SetFormat,Integer,DEC
	DllCall(&quot;snap7.dll\Cli_DBWrite&quot;, &quot;Ptr&quot;, obj, &quot;Int&quot;, db, &quot;int&quot;, start, &quot;int&quot;, size, &quot;ptr&quot;, &amp;data) 
	return
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Raven]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30150</uri>
			</author>
			<updated>2017-09-20T07:06:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=119418#p119418</id>
		</entry>
</feed>
