I am trying to get a global key press for my windows form without overwriting it globally. I've tried setting Keypress = true
but that only gets the keys pressed if the form is active, I've also tried to hook the key globally using
[DllImport("user32.dll")]
private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk);
[DllImport("user32.dll")]
private static extern bool UnregisterHotKey(IntPtr hWnd, int id);
but that overwrites the key which I don't want to do. Is there a happy medium somewhere where I can detect the key press globally without overwriting it?
Thanks