public void RegistAllUnregister() { foreach (int index in HotKeys) { WinLib.UnregisterHotKey((int)this.Handle, index); } }
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); } }