NOTE: This page has been translated automatically from Russian to English. Original page.



Trey messenger: Native BK for 8.x

1C icon in the system tray to popup-MENU, balluny, alerts, feedback. Made by Native technology, does not require registration in the register and the special rights of the user. It has feedback 1C through the generation of external events. It has a popup-menu on the tray icon for managing the window 1C (close, hide, show +2 points event generation). It is possible to remove the button of the main window from the taskbar.

Highly respected and no less verbose O-Planet 06.09.2013 published

Tray Informer with the fiction that was already jealous Laughing .

The test results turned out to be:

1. The component requires in BORLNDMM.DLL system (installed with the programming environment)

2. Paragraph 1 is not yet a very sad, sad thing is that there is still need CC3280MT.DLL, which requires registration in the register, which creates problems for users with limited rights.

Comments (70) (72) (74)

3. Feedback to 1C there.


This VC requires nothing but itself, made by Native technology, ie It does not require registration in the register and the special rights of the user. It has feedback 1C through the generation of external events. It has a popup-menu on the tray icon for managing the window 1C (close, hide, show). It is possible to remove the button of the main window from the taskbar.

Connecting components:

PodklyuchitVneshnyuyuKomponentu (PolnoeImyaFaylaVK, "TrayMessenger", AddInType.Native);

When you connect the icon from the resource VC immediately placed in the tray, set the default hint: "1C-Enterprise"
intsializiruetsya popup-menu.

Creating a class instance:

Trey = new ( "AddIn.TrayMessenger.V8TrayMessenger") // left - any variable

Methods VC:

Ballun (Text, Title, TipIkonki, VremyaPokaza) - displays standard ballun tray icons at time = VremyaPokaza (s)

TipIkonki - number; 0, no icons, 1-information-2 alert 3 error

Clicking on ballune it closes and generates an external event. Event = TekuschiyZagolovokBalluna,

Data = TekuschiyTekstBalluna

Notification (Title, Text, ImyaFaylaKartinki, VremyaPokaza) - displays the notification window in the lower right corner of the screen.

When clicking on the warning generated by an external event, and the window closes.

Almost similar to PokazatOpovescheniePolzovatelya but
no "Shows a window, the default screen is at the bottom,
which gradually fades and disappears from the screen. "It will be displayed as necessary.

If the image file name is not specified, or the specified file does not exist, displays a picture of the resource VC

Note: The image file - only BMP!

Icon (ImyaFaylaIkonki) - sets specified an icon in the system tray
ImyaFaylaIkonki If not specified or there is no such file uses an icon from a resource VC

Note: I did not like how it looks in the system tray icon is round, so the resource - slightly modified.

Hint (TekstHinta) - sets a new hint for tray icon

UbratIzPaneliZadach () - no parameters removes the button of the main window from the taskbar, t.e.ostanetsya only the tray-icon

Popup-Menu - caused by right-clicking on the tray icon,
items: Close 1C, 1C Hide window Show the window 1C

Double-click on the icon expands and 1C window pops to the foreground.

Note: Refer to the "general view" icon in the system tray, and picture-in notification of resource VC

Tested on:

Windows Server 2008 R2 Standard x 64, SQL database

Windows 7 Ultimate 32's, file database  

version 1.1.0.3

Improved by comments 1-20.

The method of notification added option PoTsentru if True, the alert window is displayed on the center of the screen.

Default - Lies (lower right corner).

Additional explanations on the warning window: the window has StayOnTop style, ie, always on top.

If VremyaPokaza = 0 - will "hang" on the screen 24 hours or until closed by the user, i.e. wants, he does not want to see a window.

version 1.1.0.5

For the convenience of taxi users decided to add a couple more points popup-menu on the icon in the system tray:

External event 1 and 2. External event Pressing generate respectively EXT_MESSAGE1_CLICK Events

EXT_MESSAGE2_CLICK.

Process it is necessary, of course, in the 1C on the subject of what to do next

Example:

Если Источник="TRAY_MESSENGER" Тогда  Если Событие="EXT_MESSAGE1_CLICK" Тогда   Трей.Оповещение("АДМИНИСТРАТОР","Прошу выйти из 1С до особого сообщения","",60,ИСТИНА);   Константы.ЗавершитьРаботу.Установить(Истина);  КонецЕсли;  Если Событие="EXT_MESSAGE2_CLICK" Тогда   // придумать чего-нибудь ;)  КонецЕсли; КонецЕсли; 

version 1.0.0.7

I attach extra. menu items, and thought .. but as a simple Find Topics Find Topics will reap them, and I, for one, want one of them to attach vygonyalku accessible only to me?

Therefore, I added a couple of features:

PokazyvatMenyu (True / False) and PokazyvatDopolnitelnyePunktyMenyu (True / False)

Example:

Трей.ПоказыватьМеню=Ложь;// отключаем меню исконки полностью Трей.ПоказыватьМеню=Истина; // включаем меню исконки полностью Трей.ПоказыватьДополнительныеПунктыМеню=Ложь; // отключаем доп. пункты Трей.ПоказыватьДополнительныеПунктыМеню=Истина; // включаем доп. пункты 

version 1.0.0.9

 

At the request of the commentary (60) added a parameter to the method Alert - TekstVneshnegoSobytiya

Option number 6, default is empty. If empty, the external event data = text, otherwise TekstVneshnegoSobytiya.

Notification (Title, Text, ImyaFaylaKartinki, VremyaPokaza, PoTsentru, TekstVneshnegoSobytiya)

By clicking on the Alerts window 1C turns and pushed to the fore

version 1.0.0.11

Added method
ObnovitOpoveschenie (subject, text) - updates the title and text of an existing window notifications.

At the same time, new methods include:
Ubit1S () - no parameters, as a last resort to oust user (kills the current process 1C)
Latency (VremyaZaderzhki) - in milliseconds, optional, 50 milliseconds by default

version 1.0.0.15

Added methods:

UstanovitGlavnyyTaymer (Interval) - 1C timer on the main window. The interval, in milliseconds, default 60000

When triggered, it generates an external event MAIN_TIMER_EVENT (data - interval timer)

Each new timer setting overrides the previous one.

OtklyuchitGlavnyyTaymer () - no parameters, disables (destroys) the previously set timer

UstanovitObratnyyTaymer (Interval) - a one-time timer on the main window 1C.

When triggered, it generates an external event BACK_TIMER_EVENT (data - interval timer) and self-destructs.

A sample code in the 1C:

//--- модуль обычного приложения--- Перем Трей Экспорт; Функция КаталогИБ() Экспорт  КаталогИБ = СтрокаСоединенияИнформационнойБазы();  КаталогИБ = Сред(КаталогИБ,7,СтрДлина(КаталогИБ)-8) + "\";  Возврат КаталогИБ; КонецФункции Процедура ПриНачалеРаботыСистемы()  ФайлВК=КаталогИБ()+"TrayMessenger.dll";  Файл= Новый Файл(ФайлВК);  Если Файл.Существует() Тогда    //-- подключение компоненты--    ПодключитьВнешнююКомпоненту(ФайлВК,"TrayMessenger",AddInType.Native);    // Примечание: при подключении иконка СРАЗУ помещается в трей,    // устанавливается хинт по умолчанию: "1С-Предприятие",    // инциализируется popup-menu    //-- создание экземпляра класса--    Трей =  Новый("AddIn.TrayMessenger.V8TrayMessenger");    //---- вывод баллуна------    Заголовок="Всем! Всем! Всем!";    Текст="Прошу выйти из 1С";    ТипИконки=2; //0-нет иконки, 1-информация, 2-предупреждение,3-ошибка    ВремяПоказа=5;    //Трей.Баллун(Текст,Заголовок,ТипИконки,ВремяПоказа);    //---- вывод оповещения------    Заголовок="Всем! Всем! Всем!";    Текст="Прошу выйти из 1С";    ИмяФайлаКартинки=""; // пусто - из ресурса ВК    ВремяПоказа=25;    //Трей.Оповещение(Заголовок,Текст,ИмяФайлаКартинки,ВремяПоказа);    // убираем иконку 1С из Панели Задач    Трей.УбратьИзПанелиЗадач();  Иначе    Сообщить("Не обнаружен файл ВК, скопируйте ""TrayMessenger.dll"" в КаталогИБ "    +ФайлВК,СтатусСообщения.Информация);  КонецЕсли; КонецПроцедуры Процедура ОбработкаВнешнегоСобытия(Источник, Событие, Данные)  Если Источник="TRAY_MESSENGER" Тогда    Сообщить("Событие: "+Событие+"; Данные: "+Данные);  КонецЕсли; КонецПроцедуры 

1C:Enterprise Developer's Community