RegisterHotKey

C# Signature:

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern bool RegisterHotKey(IntPtr hWnd, int id, KeyModifiers fsModifiers, Keys vk);

VB Signature:

Declare Function RegisterHotKey Lib "user32.dll" (TODO) As TODO

KeyModifiers Enum:

[Flags]
    public enum KeyModifiers
    {
    None = 0,
    Alt = 1,
    Control = 2,
    Shift = 4,
    // Either WINDOWS key was held down. These keys are labeled with the Windows logo.
    // Keyboard shortcuts that involve the WINDOWS key are reserved for use by the 
    // operating system.
    Windows = 8
    }

HotKeyRegister Class (Source: https://code.msdn.microsoft.com/CSRegisterHotkey-e3f5061e ):

Sample Code:

Sample Code:

Última actualización