RegisterHotKey help
C#
1
Posts
1
Posters
0
Views
1
Watching
-
I want to modify this RegisterHotKey func to allow me to set it using HashKey instead of a shortcut key but I'm not exactly sure how to do this. this is the code for registering the hotkey in the object
protected bool RegisterHotkey(Shortcut key) { //register hotkey int mod=0; Keys k2=Keys.None; if (((int)key & (int)Keys.Alt)==(int)Keys.Alt) {mod+=(int)Win32.Modifiers.MOD\_ALT;k2=Keys.Alt;} if (((int)key & (int)Keys.Shift)==(int)Keys.Shift) {mod+=(int)Win32.Modifiers.MOD\_SHIFT;k2=Keys.Shift;} if (((int)key & (int)Keys.Control)==(int)Keys.Control) {mod+=(int)Win32.Modifiers.MOD\_CONTROL;k2=Keys.Control;} System.Diagnostics.Debug.Write(mod.ToString()+" "); System.Diagnostics.Debug.WriteLine((((int)key)-((int)k2)).ToString()); return Win32.User32.RegisterHotKey(m\_Window.Handle, this.GetType().GetHashCode(), (int)mod, ((int)key) - ((int)k2)); }