<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=3638&amp;type=atom" />
	<updated>2010-12-29T13:03:18Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=3638</id>
		<entry>
			<title type="html"><![CDATA[Re: VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=43180#p43180" />
			<content type="html"><![CDATA[<p>Спасибо, избавлюсь от одной внешней компоненты.</p>]]></content>
			<author>
				<name><![CDATA[zk96]]></name>
			</author>
			<updated>2010-12-29T13:03:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=43180#p43180</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=28170#p28170" />
			<content type="html"><![CDATA[<p>Прикольная вещица получилась <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[artbear]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25179</uri>
			</author>
			<updated>2009-09-14T12:33:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=28170#p28170</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=28167#p28167" />
			<content type="html"><![CDATA[<p><strong>zamaguga</strong>, спасибо!</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2009-09-14T11:48:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=28167#p28167</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=28164#p28164" />
			<content type="html"><![CDATA[<p>Код писался для 1С-ки, проверено, работает 100%</p><div class="codebox"><pre><code>Перем MSScript;
//_____________________________________________________________________________
Процедура ДобавитьИконкуВТрей() Экспорт
    Если MSScript &lt;&gt; 0 Тогда Возврат; КонецЕсли;      
    Code = &quot;
    |Public Const IMAGE_ICON       = 1
    |Public Const NIIF_NONE        = &amp;H0
    |Public Const NIIF_WARNING     = &amp;H2
    |Public Const NIIF_ERROR       = &amp;H3
    |Public Const NIIF_INFO        = &amp;H1
    |Public Const NIIF_GUID        = &amp;H4
    |Public Const NIF_TIP          = 4
    |Public Const NIF_MESSAGE      = 1
    |Public Const NIF_STATE        = &amp;H8
    |Public Const NIF_INFO         = &amp;H10
    |Public Const NIM_ADD          = 0
    |Public Const NIM_DELETE       = 2
    |Public Const NIM_MODIFY       = 1 
    |Public Const NIF_ICON         = 2
    |Public Const VK_ESCAPE        = &amp;H1B
    |Public Const WM_MOUSEMOVE     = &amp;H200
    |Public Const WM_LBUTTONDOWN   = &amp;H201
    |Public Const WM_LBUTTONUP     = &amp;H202
    |Public Const WM_LBUTTONDBLCLK = &amp;H203
    |Public Const WM_RBUTTONDOWN   = &amp;H204
    |Public Const WM_RBUTTONUP     = &amp;H205
    |Public Const WM_RBUTTONDBLCLK = &amp;H206
    |Public Const WM_SHELLNOTIFY   = &amp;H405
    |
    |Public DX
    |Set DX  = CreateObject(&quot;&quot;DynamicWrapperX&quot;&quot;)     
    |DX.Register &quot;&quot;SHELL32&quot;&quot;, &quot;&quot;Shell_NotifyIcon&quot;&quot;, &quot;&quot;i=ll&quot;&quot;, &quot;&quot;r=l&quot;&quot;  
    |DX.Register &quot;&quot;KERNEL32&quot;&quot;,&quot;&quot;LoadLibraryA&quot;&quot;,&quot;&quot;i=s&quot;&quot;,&quot;&quot;r=l&quot;&quot;
    |DX.Register &quot;&quot;USER32&quot;&quot;,&quot;&quot;LoadImageA&quot;&quot;,&quot;&quot;i=llllll&quot;&quot;,&quot;&quot;r=l&quot;&quot;
    |DX.Register &quot;&quot;KERNEL32&quot;&quot;,&quot;&quot;FreeLibrary&quot;&quot;,&quot;&quot;i=l&quot;&quot;
    |DX.Register &quot;&quot;KERNEL32&quot;&quot;,&quot;&quot;RtlMoveMemory&quot;&quot;,&quot;&quot;i=lll&quot;&quot;,&quot;&quot;r=l&quot;&quot;
    |DX.Register &quot;&quot;KERNEL32&quot;&quot;,&quot;&quot;HeapAlloc&quot;&quot;,&quot;&quot;i=lll&quot;&quot;,&quot;&quot;r=l&quot;&quot;
    |DX.Register &quot;&quot;KERNEL32&quot;&quot;,&quot;&quot;GetProcessHeap&quot;&quot;,&quot;&quot;r=l&quot;&quot;
    |DX.Register &quot;&quot;KERNEL32&quot;&quot;,&quot;&quot;HeapFree&quot;&quot;,&quot;&quot;i=lll&quot;&quot;,&quot;&quot;r=l&quot;&quot;
    |
    |Public  TrayIcon   
    |Private TrayIconInitialized
    |
    |Class NOTIFYICONDATA 
    |   Private hHeap,init
    |   &#039;Создание класса
    |    Private Sub Class_Initialize     
    |        hHeap = DX.GetProcessHeap() 
    |        init  = DX.HeapAlloc(hHeap,0,488)  
    |    End Sub 
    |   &#039;Уничтожение класса
    |    Private Sub Class_Terminate   
    |        DX.HeapFree hHeap,0,init
    |    End Sub
    |   &#039;Базовый адрес
    |   Public Property Get dwAddress
    |       dwAddress = init
    |   End Property
    |   &#039;Конвкптация значения
    |    Private Function ConvertData(dwData)
    |       hW = Fix(dwData/65536)
    |       lW = dwData mod 65536 
    |       ConvertData = ChrW(lW) &amp; ChrW(hW) 
    |    End Function
    |   &#039;Размер базы
    |   Public Property Get cbSize
    |       cbSize = 488
    |   End Property
    |   Public Property Let cbSize(Value)
    |       iOfs  = 0: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |   &#039;Дескриптор родителя
    |   Public Property Let hWnd(Value)
    |       iOfs  = 4: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |   &#039;Идентификатор
    |   Public Property Let uID(Value)
    |       iOfs  = 8: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |   &#039;Флаги отображения
    |   Public Property Let uFlags(Value)
    |       iOfs  = 12: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |   &#039;Флаги событий
    |   Public Property Let uCallbackMessage(Value)
    |       iOfs  = 16: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |   &#039;Хэндл иконки
    |   Public Property Let hIcon(Value)
    |       iOfs  = 20: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |   &#039;Всплывающая подсказка
    |   Public Property Let szTip(Value)
    |       iOfs  = 24: iSize = 128
    |       sData = Left(Value,iSize - 1) &amp; vbNullchar
    |       For i = 1 To iSize
    |           DX.RtlMovememory init + iOfs - 1 + i, DX.StrPtr(Mid(sData,i,1), &quot;&quot;s&quot;&quot;), 1
    |       Next
    |   End Property
    |   &#039;Текст информац.сообщения
    |   Public Property Let szInfo(Value)
    |       iOfs  = 160: iSize = 256
    |       sData = Left(Value,iSize - 1) &amp; vbNullchar
    |       For i = 1 To iSize
    |           DX.RtlMovememory init + iOfs - 1 + i, DX.StrPtr(Mid(sData,i,1), &quot;&quot;s&quot;&quot;), 1
    |       Next
    |   End Property
    |   &#039;Иконка информац.сообщения
    |   Public Property Let dwInfoFlags(Value)
    |       iOfs  = 484: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |   &#039;Заголовок информац.сообщения
    |   Public Property Let szInfoTitle(Value)
    |       iOfs  = 420: iSize = 64
    |       sData = Left(Value,iSize - 1) &amp; vbNullchar
    |       For i = 1 To iSize
    |           DX.RtlMovememory init + iOfs - 1 + i, DX.StrPtr(Mid(sData,i,1), &quot;&quot;s&quot;&quot;), 1
    |       Next
    |   End Property
    |   &#039;Время показа информац.сообщения
    |   Public Property Let uTimeout(Value)
    |       iOfs  = 416: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |   &#039;Статус
    |   Public Property Let dwState(Value)
    |       iOfs  = 152: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |   &#039;Маска статуса
    |   Public Property Let dwStateMask(Value)
    |       iOfs  = 156: iSize = 4
    |       sData = ConvertData(Value)
    |       DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
    |   End Property
    |End Class
    |
    |Class NotifyIcon 
    |    Private SysTray
    |    Private SysTrayActivated
    |   &#039;Создание класса
    |    Private Sub Class_Initialize     
    |        Set SysTray = New NOTIFYICONDATA
    |    End Sub 
    |   &#039;Уничтожение класса
    |    Private Sub Class_Terminate  
    |        Delete
    |        Set SysTray = Nothing
    |    End Sub
    |   &#039;Помещаем иконку в трей
    |    Public Function Init(hWnd,ToolTip,hIcon)  
    |        If SysTrayActivated Then
    |           Exit Function
    |        End If
    |        With SysTray    
    |           .cbSize           = .cbSize
    |           .hWnd             = hWnd
    |           .uID              = vbNull
    |           .uFlags           = NIF_ICON Or NIF_TIP
    |           .uCallbackMessage = WM_MOUSEMOVE
    |           .hIcon            = hIcon
    |           .szTip            = ToolTip
    |           .dwState          = 0
    |           .dwStateMask      = 0
    |           DX.Shell_NotifyIcon NIM_ADD,.dwAddress  
    |        End With
    |        SysTrayActivated = True
    |        Init = SysTray.dwAddress
    |    End Function
    |   &#039;Удаляем иконеу из трея
    |    Public Sub Delete()  
    |        If Not SysTrayActivated Then
    |           Exit Sub
    |       End If
    |       DX.Shell_NotifyIcon NIM_DELETE,SysTray.dwAddress
    |        Set SysTray = Nothing
    |        SysTrayActivated = False  
    |    End Sub
    |   &#039;Показать уведомление
    |    Public Sub Modify(TextMessage, Title, IconFlag, Timeout)  
    |        If Not SysTrayActivated Then
    |           Exit Sub
    |       End If 
    |        With SysTray
    |           .uFlags      = NIF_ICON Or NIF_INFO Or NIF_MESSAGE Or NIF_TIP
    |           .szInfo      = TextMessage
    |           .szInfoTitle = Title
    |           .dwInfoFlags = IconFlag
    |           .uTimeout    = Timeout
    |           DX.Shell_NotifyIcon NIM_MODIFY,.dwAddress  
    |        End With
    |    End Sub
    |End Class
    |
    |Public Function TrayIconInit(hWnd,ToolTip,hIcon) 
    |    If TrayIconInitialized Then
    |       Exit Function
    |    End If
    |    If Len(Trim(ToolTip)) = 0 Then
    |       ToolTip = &quot;&quot;1С:Предприятие 7.7&quot;&quot;
    |    End If
    |    If  CLng(hIcon) = 0 Then
    |        hLib  = DX.LoadLibraryA(&quot;&quot;&quot; + КаталогПрограммы() + &quot;1crcrus.dll&quot;&quot;)  
    |        hIcon = DX.LoadImageA(hLib,128,IMAGE_ICON,16,16,0)        
    |        DX.FreeLibrary hLib
    |   End If
    |    Set TrayIcon = New NotifyIcon  
    |    TrayIconInitialized = True
    |   TrayIconInit = TrayIcon.Init(hWnd,ToolTip,hIcon)
    |End Function
    |
    |Public Sub TrayIconModify(TextMessage,Title,Icon, Timeout)  
    |   Dim IconFlag
    |    If Not TrayIconInitialized Then
    |       Exit Sub
    |    End If
    |    If Timeout = 0 Then
    |       Timeout = 50
    |    End If
    |      Select Case Icon
    |          Case 1 
    |              IconFlag = NIIF_INFO
    |            If Len(Trim(Title)) = 0 Then
    |               Title = &quot;&quot;Информация&quot;&quot;
    |            End If
    |          Case 2 
    |              IconFlag = NIIF_WARNING
    |            If Len(Trim(Title)) = 0 Then
    |               Title = &quot;&quot;Внимание&quot;&quot;
    |            End If
    |          Case 3 
    |              IconFlag = NIIF_ERROR
    |            If Len(Trim(Title)) = 0 Then
    |               Title = &quot;&quot;Ошибка&quot;&quot;
    |            End If
    |          Case 4 
    |              IconFlag = NIIF_GUID
    |            If Len(Trim(Title)) = 0 Then
    |               Title = &quot;&quot;1С:Предприятие 7.7&quot;&quot;
    |            End If
    |        Case Else 
    |              IconFlag = NIIF_NONE
    |           Title = vbNullString
    |    End Select 
    |   TrayIcon.Modify TextMessage, Title, IconFlag, Timeout
    |End Sub
    |
    |Public Sub TrayIconDelete()  
    |    If Not TrayIconInitialized Then
    |       Exit Sub
    |    End If
    |   TrayIcon.Delete
    |    Set TrayIcon = Nothing
    |    TrayIconInitialized = False
    |End Sub
    |
    |&quot;;
    MSScript = CreateObject(&quot;MSScriptControl.ScriptControl&quot;);
    MSScript.Language=&quot;vbscript&quot;;  
    MSScript.AddCode(Code);
    MSScript.Modules(&quot;Global&quot;).CodeObject.TrayIconInit(Дескриптор1С,&quot;&quot;,0);     
КонецПроцедуры //ДобавитьИконкуВТрей  
//_____________________________________________________________________________
Процедура УдалитьИконкуИзТрея() Экспорт
    Если MSScript = 0 Тогда Возврат; КонецЕсли;    
    MSScript.Modules(&quot;Global&quot;).CodeObject.TrayIconDelete(); 
    MSScript = 0;    
КонецПроцедуры //УдалитьИконкуИзТрея       
//_____________________________________________________________________________
Процедура ПоказатьУведомление(Текст,Иконка = 1,Заголовок = &quot;&quot;,Таймаут = 50) Экспорт
    Если MSScript = 0 Тогда ДобавитьИконкуВТрей(); КонецЕсли;    
    MSScript.Modules(&quot;Global&quot;).CodeObject.TrayIconModify(Текст, Заголовок, Иконка, Таймаут);     
КонецПроцедуры //ПоказатьУведомление  
MSScript = 0;</code></pre></div><p>Юзайте на здоровье.<br />На Вашем форуме я новичок, поэтому скриншот приаттачить не удалось</p>]]></content>
			<author>
				<name><![CDATA[zamaguga]]></name>
			</author>
			<updated>2009-09-14T10:22:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=28164#p28164</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=28161#p28161" />
			<content type="html"><![CDATA[<p>Я бы тоже не отказался увидеть результат, поскольку код, приведённый в #1, в качестве рабочего примера не годится — не на чем пробовать.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2009-09-14T09:59:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=28161#p28161</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=28156#p28156" />
			<content type="html"><![CDATA[<p>Всем спасибо, разобрался сам, просто при выполнении &quot;StrPtr&quot; надо было указать тип &quot;s&quot; (по умолчанию он &quot;w&quot;)</p>]]></content>
			<author>
				<name><![CDATA[zamaguga]]></name>
			</author>
			<updated>2009-09-14T07:47:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=28156#p28156</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=28143#p28143" />
			<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>2009-09-14T06:36:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=28143#p28143</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=28137#p28137" />
			<content type="html"><![CDATA[<p>ОФФ. Подскажи, плиз,<br />Последняя версия DynamicWrapperX - это <br /><a href="http://www.script-coding.com/dynwrapx1_00.zip">http://www.script-coding.com/dynwrapx1_00.zip</a><br />(версия 1.0.0.0 от 05.09.2008 г., архив 14 191 байт).<br />??</p>]]></content>
			<author>
				<name><![CDATA[artbear]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25179</uri>
			</author>
			<updated>2009-09-14T04:20:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=28137#p28137</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=28133#p28133" />
			<content type="html"><![CDATA[<p>А в каком формате выводимая строка? Если в Юникоде, то нужна, вероятно, Shell_NotifyIconW.</p><p>Разобраться в Вашем коде мне сложновато, т.к. VBS знаю слабо. Подскажите, как его запустить, чтобы увидеть эти самые кракозябры. Почитаю пока про Shell_NotifyIcon, чтобы разобраться, как она работает.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2009-09-14T03:44:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=28133#p28133</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBScript:DynamicWrapperX, Shell_NotifyIcon и русский язык]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=28130#p28130" />
			<content type="html"><![CDATA[<p>Написал небольшой скрипт для установки иконки в трей и вывола уведомления.<br />Работает, но при выволе уведомления или хинта на русском - кпакозябры. Вот фрагмент кода:</p><div class="codebox"><pre><code>Public Const IMAGE_ICON       = 1
Public Const NIIF_NONE        = &amp;H0
Public Const NIIF_WARNING     = &amp;H2
Public Const NIIF_ERROR       = &amp;H3
Public Const NIIF_INFO        = &amp;H1
Public Const NIIF_GUID        = &amp;H4
Public Const NIF_TIP          = 4
Public Const NIF_MESSAGE      = 1
Public Const NIF_STATE        = &amp;H8
Public Const NIF_INFO         = &amp;H10
Public Const NIM_ADD          = 0
Public Const NIM_DELETE       = 2
Public Const NIM_MODIFY       = 1 
Public Const NIF_ICON         = 2
Public Const VK_ESCAPE        = &amp;H1B
Public Const WM_MOUSEMOVE     = &amp;H200
Public Const WM_LBUTTONDOWN   = &amp;H201
Public Const WM_LBUTTONUP     = &amp;H202
Public Const WM_LBUTTONDBLCLK = &amp;H203
Public Const WM_RBUTTONDOWN   = &amp;H204
Public Const WM_RBUTTONUP     = &amp;H205
Public Const WM_RBUTTONDBLCLK = &amp;H206
Public Const WM_SHELLNOTIFY   = &amp;H405
Public Const NID_SIZE         = 488

Public DX
Public TrayIcon   

Set DX = CreateObject(&quot;DynamicWrapperX&quot;)     
DX.Register &quot;SHELL32&quot;, &quot;Shell_NotifyIcon&quot;, &quot;i=ll&quot;, &quot;r=l&quot;  
DX.Register &quot;KERNEL32&quot;,&quot;LoadLibraryA&quot;,&quot;i=s&quot;,&quot;r=l&quot;
DX.Register &quot;USER32&quot;,&quot;LoadImageA&quot;,&quot;i=llllll&quot;,&quot;r=l&quot;
DX.Register &quot;KERNEL32&quot;,&quot;FreeLibrary&quot;,&quot;i=l&quot;
DX.Register &quot;KERNEL32&quot;,&quot;RtlMoveMemory&quot;,&quot;i=lll&quot;,&quot;r=l&quot;
DX.Register &quot;KERNEL32&quot;,&quot;HeapAlloc&quot;,&quot;i=lll&quot;,&quot;r=l&quot;
DX.Register &quot;KERNEL32&quot;,&quot;GetProcessHeap&quot;,&quot;r=l&quot;
DX.Register &quot;KERNEL32&quot;,&quot;HeapFree&quot;,&quot;i=lll&quot;,&quot;r=l&quot;


Class NOTIFYICONDATA 
    Private hHeap,init
    Private Sub Class_Initialize     
        hHeap = DX.GetProcessHeap() 
        init  = DX.HeapAlloc(hHeap,0,NID_SIZE)  
    End Sub 
    Private Sub Class_Terminate   
        DX.HeapFree hHeap,0,init
    End Sub  
    
    Public Property Get BaseAddr
        BaseAddr = init
    End Property
    Public Property Get Size
        Size = NID_SIZE
    End Property  
    
    Private Function ConvertData(dwData)
        hW = Fix(dwData/65536)
        lW = dwData mod 65536 
        ConvertData = ChrW(lW) &amp; ChrW(hW) 
    End Function
    Public Sub SetData(strName,varData)
        Dim iOfs, iSize, sData
        Select Case strName
            Case &quot;cbSize&quot;
                iOfs  = 0: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
            Case &quot;hWnd&quot;
                iOfs  = 4: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
            Case &quot;uID&quot;
                iOfs  = 8: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
            Case &quot;uFlags&quot;
                iOfs  = 12: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
            Case &quot;uCallbackMessage&quot;
                iOfs  = 16: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
            Case &quot;hIcon&quot;
                iOfs  = 20: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
            Case &quot;szTip&quot;
                sData = Left(varData,127) &amp; vbNullchar
                iOfs  = 24: iSize = 128
                For i = 1 To iSize
                    DX.RtlMovememory init + iOfs - 1 + i, DX.StrPtr(Mid(sData,i,1)), 1
                Next
            Case &quot;dwState&quot;
                iOfs  = 152: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
            Case &quot;dwStateMask&quot;
                iOfs  = 156: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
            Case &quot;szInfo&quot;
                sData = Left(varData,255) &amp; vbNullchar
                iOfs  = 160: iSize = 256
                For i = 1 To iSize
                    DX.RtlMovememory init + iOfs - 1 + i, DX.StrPtr(Mid(sData,i,1)), 1
                Next
            Case &quot;uTimeout&quot;
                iOfs  = 416: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
            Case &quot;szInfoTitle&quot;
                sData = Left(varData,63) &amp; vbNullchar
                iOfs  = 420: iSize = 64
                For i = 1 To iSize
                    DX.RtlMovememory init + iOfs - 1 + i, DX.StrPtr(Mid(sData,i,1)), 1
                Next
            Case &quot;dwInfoFlags&quot;
                iOfs  = 484: iSize = 4
                sData = ConvertData(varData)
                DX.RtlMovememory init + iOfs, DX.StrPtr(sData), iSize
        End Select
    End Sub
End Class
        
Class NotifyIcon 
    Private SysTray
    Private SysTrayActivated
    Private Sub Class_Initialize     
        Set SysTray = New NOTIFYICONDATA
    End Sub 
    Private Sub Class_Terminate  
        Delete
        Set SysTray = Nothing
    End Sub  
    
    Public Function Init(hWnd,ToolTip,hIcon)  
        If SysTrayActivated Then
            Exit Function
        End If
        With SysTray    
            .SetData &quot;cbSize&quot;,              .Size
            .SetData &quot;hWnd&quot;,              hWnd
            .SetData &quot;uID&quot;,              vbNull
            .SetData &quot;uFlags&quot;,           NIF_ICON Or NIF_TIP
            .SetData &quot;uCallbackMessage&quot;, WM_MOUSEMOVE
            .SetData &quot;hIcon&quot;,              hIcon
            .SetData &quot;szTip&quot;,              ToolTip
            .SetData &quot;dwState&quot;,          0
            .SetData &quot;dwStateMask&quot;,      0
        End With
        DX.Shell_NotifyIcon NIM_ADD,SysTray.BaseAddr  
        SysTrayActivated = True
        Init = SysTray.baseAddr
    End Function

    Public Sub Delete()  
        If Not SysTrayActivated Then
            Exit Sub
        End If
        DX.Shell_NotifyIcon NIM_DELETE,SysTray.BaseAddr
        Set SysTray = Nothing
        SysTrayActivated = False  
    End Sub 
    
    Public Sub Modify(Text, Title, Icon, Timeout)  
        If Not SysTrayActivated Then
            Exit Sub
        End If 
        With SysTray
            .SetData &quot;uFlags&quot;,      NIF_ICON Or NIF_INFO Or NIF_MESSAGE Or NIF_TIP
            .SetData &quot;szInfo&quot;,      Text
            .SetData &quot;szInfoTitle&quot;, Title
            .SetData &quot;dwInfoFlags&quot;, Icon
            .SetData &quot;uTimeout&quot;,    Timeout
        End With
        DX.Shell_NotifyIcon NIM_MODIFY,SysTray.BaseAddr  
    End Sub
End Class</code></pre></div><p>Подскажите кто-нибудь, как заставить скрипт работать на русском?</p>]]></content>
			<author>
				<name><![CDATA[zamaguga]]></name>
			</author>
			<updated>2009-09-13T17:47:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=28130#p28130</id>
		</entry>
</feed>
