Method must have a return type in C# Class
I'm building a Global Hotkey class for my app and I'm getting this: "Method must have a return type".
I'm building a Global Hotkey class for my app and I'm getting this: "Method must have a return type".
This is the code that I am currently using(it is from HTML Wizards
```class HotKeys { public GlobalHotkey(int modifier, Keys key, Form form) //GlobalHotkey is giving me the error given before { this.modifier = modifier; this.key = (int)key; this.hWnd = form.Handle; id = this.GetHashCode();
}
public static class Constants
{
//modifiers
public const int NOMOD = 0x0000;
public const int ALT = 0x0001;
public const int CTRL = 0x0002;
public const int SHIFT = 0x0004;
public const int WIN = 0x0008;
//window message id for hotkey
public const int WM_HOTKEY_MSG_ID = 0x0312;
}
private int modifier;
private int key;
private IntPtr hWnd;
private int id;
[DllImport("user32.dll")]
private static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk);
[DllImport("user32.dll")]
private static extern bool UnregisterHotKey(IntPtr hWnd, int id);
public override int GetHashCode()
{
return modifier ^ key ^ hWnd.ToInt32();
}
public bool Register()
{
return RegisterHotKey(hWnd, id, modifier, key);
}
public bool Unregister()
{
return UnregisterHotKey(hWnd, id);
}
}
```
Thanks in Advance - Cheers - Jesse