This article shows how to register and manage System-Global hotkeys in WinForm and WPF applications and perform some keyboard manipulation from your app and has a custom hotkey control.
- Manager.zip
- Global Shortcut Manager
- BondTech.HotKeyManagement.WPF.4
- BondTech.HotkeyManager.Win
- BondTech.HotKeyManager.WPF
- desktop.ini
- Global Shortcut Manager.sln
- Global Shortcut Manager.suo
- Global Shortcut.Win-CS
- GlobalShortcutCS.Win
- GlobalShortcutCS.WPF
- HotKeyControl.png
- Thumbs.db
- Demo.zip
- HotKeyManager Demo.exe
- Dlls.zip
- Win
- HotkeyManagement.dll
- HotkeyManagement.pdb
- WPF 3.0
- HotKeyManagement.WPF.dll
- HotKeyManagement.WPF.pdb
- WPF 4.0
- HotKeyManagement.WPF.4.dll
- HotKeyManagement.WPF.4.pdb
|
using System;
using System.Runtime.Serialization;
namespace BondTech.HotKeyManagement.WPF
{
[Serializable]
public class HotKeyAlreadyRegisteredException : Exception
{
public GlobalHotKey HotKey { get; private set; }
public LocalHotKey LocalKey { get; private set; }
public ChordHotKey ChordKey { get; private set; }
public HotKeyAlreadyRegisteredException(string message, GlobalHotKey hotKey) : base(message) { HotKey = hotKey; }
public HotKeyAlreadyRegisteredException(string message, GlobalHotKey hotKey, Exception inner) : base(message, inner) { HotKey = hotKey; }
public HotKeyAlreadyRegisteredException(string message, LocalHotKey hotKey) : base(message) { LocalKey = hotKey; }
public HotKeyAlreadyRegisteredException(string message, LocalHotKey hotKey, Exception inner) : base(message, inner) { LocalKey = hotKey; }
public HotKeyAlreadyRegisteredException(string message, ChordHotKey hotKey) : base(message) { ChordKey = hotKey; }
public HotKeyAlreadyRegisteredException(string message, ChordHotKey hotKey, Exception inner) : base(message, inner) { ChordKey = hotKey; }
protected HotKeyAlreadyRegisteredException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
}
[Serializable]
public class HotKeyUnregistrationFailedException : Exception
{
public GlobalHotKey HotKey { get; private set; }
public HotKeyUnregistrationFailedException(string message, GlobalHotKey hotKey) : base(message) { HotKey = hotKey; }
public HotKeyUnregistrationFailedException(string message, GlobalHotKey hotKey, Exception inner) : base(message, inner) { HotKey = hotKey; }
protected HotKeyUnregistrationFailedException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
}
[Serializable]
public class HotKeyRegistrationFailedException : Exception
{
public GlobalHotKey HotKey { get; private set; }
public HotKeyRegistrationFailedException(string message, GlobalHotKey hotKey) : base(message) { HotKey = hotKey; }
public HotKeyRegistrationFailedException(string message, GlobalHotKey hotKey, Exception inner) : base(message, inner) { HotKey = hotKey; }
protected HotKeyRegistrationFailedException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
}
[Serializable]
public class HotKeyInvalidNameException : Exception
{
public HotKeyInvalidNameException(string message) : base(message) { }
public HotKeyInvalidNameException(string message, Exception inner) : base(message, inner) { }
protected HotKeyInvalidNameException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Bond is a Physics student in a college in Nigeria.
Started programming right after high school and has fallen in love with computers ever since. Likes using the word 'seriously' and is a big fan of movies especially sci-fi.
Bond is a precise, honest, caring, down to earth gentleman.
He understands that being negative is easy. There will always be a downside to everything good, a hurdle to everything desirable and a con to every pro. He has realized that the real courage is in finding the good in what you have, the opportunities in every hurdle and the pros in every con.