Пример #1
0
        public NewMacro()
        {
            InitializeComponent();

            KeyboardHook.CreateHook();
            KeyboardHook.KeyPressed += KeyboardHook_KeyPressed;
            MouseHook.CreateHook();
            MouseHook.MouseAction += MouseHook_MouseAction;

            stopwatch = new Stopwatch();

            trayMenu = new ContextMenu();
            trayMenu.MenuItems.Add("Open", btnAbrir_Click);
            trayMenu.MenuItems.Add("Record/Pause", buttonRecord_Click);
            trayMenu.MenuItems.Add("Stop", buttonStop_Click);
            trayMenu.MenuItems.Add("Sair", btnFechar_Click);

            notifyIcon = new NotifyIcon();
            notifyIcon.MouseDoubleClick += notifyIcon_MouseDoubleClick;
            notifyIcon.Icon              = Resources.space;
            notifyIcon.ContextMenu       = trayMenu;
            notifyIcon.Visible           = true;

            ChangeLabelRecorder(RecorderStatus.Ready);
        }