private void button1_Click(object sender, EventArgs e) { try { _hkID = _hotkey.Register(Modifiers.Win, Keys.NumPad0); _shWindow = ShowHideNativeWindow.Find("TscShellContainerClass", null); labelIndi.BackColor = Color.Green; } catch (Win32Exception exc) { MessageBox.Show(exc.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button2_Click(object sender, EventArgs e) { if (_shWindow != null) { _shWindow.ReleaseHandle(); _shWindow = null; } if (_hotkey.Unregister(_hkID)) { _hkID = -1; labelIndi.BackColor = Color.Red; } }