public void RegistAllUnregister()
 {
     foreach (int index in HotKeys)
     {
         WinLib.UnregisterHotKey((int)this.Handle, index);
     }
 }
 public void RegistReregister()
 {
     foreach (int index in HotKeys)
     {
         CMacro c = k_model.macros[index];
         WinLib.RegisterHotKey((int)this.Handle, index, c.regist.modify, (int)c.regist.key);
     }
 }
Beispiel #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Win32 method
            WinLib WL = new WinLib();

            WL.form = new MacpMain();

            Application.Run(WL.form);
        }
        protected override void WndProc(ref Message m) //윈도우프로시저 콜백함수
        {
            if (m.Msg == HOTKEY)
            {
                KeyValuePair <Keys, int> keys = WinLib.InputKey(m);
                int index;
                if ((index = GetMacroKey(keys)) != -1)
                {
                    k_model.OnMacro(index);
                    return;
                }
            }

            base.WndProc(ref m);
        }
        private void OnEntry(object sender, DataGridViewCellEventArgs e)
        {
            int    index = e.RowIndex;
            CMacro c     = k_model.macros[index];

            if (((ToggleButtonCell)((DataGridViewRow)sender).Cells[0]).toggle)
            {
                WinLib.RegisterHotKey((int)this.Handle, e.RowIndex, c.regist.modify, (int)c.regist.key);
                HotKeys.Add(e.RowIndex);
            }
            else
            {
                WinLib.UnregisterHotKey((int)this.Handle, e.RowIndex);
                HotKeys.Remove(e.RowIndex);
            }
        }
        /// <summary>
        /// 데이터그리드뷰 셀 클릭 이벤트메소드
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnEntry(object sender, DataGridViewCellEventArgs e)
        {
            int row = e.RowIndex;
            int col = e.ColumnIndex;

            RegistKey regst = Ectr.GetRegist(row);

            if (MacroViewer.Clicked(row, col) == 0)
            {
                WinLib.RegisterHotKey((int)this.Handle, row, regst.modify, (int)regst.key);
                Ectr.OnActive(row);
            }
            else
            {
                WinLib.UnregisterHotKey((int)this.Handle, row);
                Ectr.UnActive(row);
            }
        }