Ejemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            // 热键定义
            textBoxStartStop.Value = model.StartStopKey;
            textBoxRecord.Value    = model.RecordKey;

            hotkey            = new GlobalHotkey(Handle);
            hotkeyIdStartStop = hotkey.RegisterHotkey(textBoxStartStop.Value.Key, textBoxStartStop.Value.Modifiers);
            hotkeyIdRecord    = hotkey.RegisterHotkey(textBoxRecord.Value.Key, textBoxRecord.Value.Modifiers);
            hotkey.OnHotkey  += OnHotkey;

            // 动作列表
            SetListView();
            if (listView.Items.Count > 0)
            {
                listView.Items[0].Selected = true;
            }
        }