<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; HTA: создание диалогов с помощью ActiveX Forms.*]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=1851&amp;type=atom" />
	<updated>2008-07-09T07:49:04Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=1851</id>
		<entry>
			<title type="html"><![CDATA[HTA: создание диалогов с помощью ActiveX Forms.*]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=12354#p12354" />
			<content type="html"><![CDATA[<p>В ветке реестра HKEY_CLASSES_ROOT, как известно, кроме задания соответствия расширений файлов и обрабатывающих их приложений, есть ещё и разделы, относящиеся к ActiveX-компонентам. В частности, если открыть эту ветку и найти разделы, начинающиеся на &quot;Forms.&quot; (довольно удобно нажать один раз &quot;F&quot; и попасть сразу на разделы, начинающиеся с &quot;F&quot;), то там можно найти следующие элементы:<br /></p><div class="quotebox"><blockquote><p>FormHost.FormHost<br />FormHost.FormHost.1<br />Forms.CheckBox.1<br />Forms.ComboBox.1<br />Forms.CommandButton.1<br />Forms.Form.1<br />Forms.Frame.1</p></blockquote></div><p>И т.д. Если, например, попытаться создать объект &quot;Forms.Form.1&quot; через CreateObject, то вы столкнётесь с тем, что зоны для отрисовки у него нет, и метод Show тоже отсутствует. Но, как ни странно, можно вставить этот объект в html-страницу с помощью тега OBJECT:<br /></p><div class="codebox"><pre><code>&lt;OBJECT id=&quot;Form1&quot; style=&quot;width:100%;height:100%;&quot; classid=&quot;clsid:C62A69F0-16DC-11CE-9E98-00AA00574A4F&quot;&gt;&lt;/OBJECT&gt;</code></pre></div><p>И хотя &quot;обычные&quot; html-объекты предоставляют весьма значительный функционал, может, у этих &quot;формочных&quot; объектов есть что-то специфическое.<br />Полный код примера:<br /></p><div class="codebox"><pre><code>&lt;HTA:APPLICATION
ID=&quot;APPLICATION&quot;
APPLICATIONNAME=&quot;Application&quot;
BORDERSTYLE=&quot;normal&quot;
CAPTION=&quot;yes&quot;
MAXIMIZEBUTTON=&quot;yes&quot;
MINIMIZEBUTTON=&quot;yes&quot;
SHOWINTASKBAR=&quot;yes&quot;
SYSMENU=&quot;yes&quot;
VERSION=&quot;1.0&quot;
WINDOWSTATE=&quot;normal&quot; 
INNERBORDER=&quot;no&quot;
SCROLL=&quot;no&quot;
CONTEXTMENU=&quot;yes&quot;
/&gt;

&lt;BODY leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0&gt;
    &lt;OBJECT id=&quot;Form1&quot; style=&quot;width:100%;height:100%;&quot; classid=&quot;clsid:C62A69F0-16DC-11CE-9E98-00AA00574A4F&quot;&gt;&lt;/OBJECT&gt;
&lt;/BODY&gt;

&lt;SCRIPT language=vbscript&gt;
    Dim TextBox1
    Set TextBox1 = Form1.Controls.Add(&quot;Forms.TextBox.1&quot;, &quot;TextBox1&quot;, True)
    TextBox1.left = 10
    TextBox1.top = 20
    TextBox1.width = 100

    Dim Image1
    Set Image1 = Form1.Controls.Add(&quot;Forms.Image.1&quot;, &quot;Image1&quot;, True)
    Image1.left = 50
    Image1.top = 50
    Image1.width = 320
    Image1.height = 240

    Set Image1.Picture = LoadPicture(&quot;C:\windows\Web\Wallpaper\Windows XP.jpg&quot;)

    Const fmPictureSizeModeClip = 0 &#039;Crops any part of the picture that is larger than the form or page (default).

    Const fmPictureSizeModeStretch = 1 &#039;Stretches the picture to fill the form or page. This setting distorts the picture in either the horizontal or vertical direction.

    Const fmPictureSizeModeZoom = 3 &#039;Enlarges the picture, but does not distort the picture in either the horizontal or vertical direction. 

    Image1.PictureSizeMode = fmPictureSizeModeStretch

&lt;/SCRIPT&gt;</code></pre></div><p>Автор идеи - <strong>Xameleon</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2008-07-09T07:49:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=12354#p12354</id>
		</entry>
</feed>
