I had been asked to create winform application where there are two comboboxes.
The first box contains options like Ctrl+Alt, Ctrl+Shift and Alt+Shift. The second box contains alphabets from a-z and numbers 0-9..
The form also contains a button called "Register". My task is that, when I click the register button, the options selected in the combo boxes must be considered as the hotkey and it should be registered. Kindly help me with the code, as I am new to this technology.
private void button1_Click(object sender, EventArgs e)
{
if (comboBox1.SelectedItem.ToString() != str && comboBox3.SelectedItem.ToString() != s)
{
str = comboBox1.SelectedItem.ToString();
byte str1 = (byte)(str)[0];
s = comboBox3.SelectedItem.ToString();
byte s1 = (byte)(s)[0];
RegisterHotKey(this.Handle, this.GetType().GetHashCode(), Win32Modifiers, s1);
}
base.WndProc(ref msg);
}
protected override void WndProc(ref Message m)
{
if(m.Msg == )
base.WndProc(ref m);
}
This is what I had did so far