How to differenciate between registered hotkeys using user32.dll

64 views Asked by At

I have registered two Hotkeys

RegisterHotKey(thiswindow, (uint) WindowKeys.Alt, 1, (int)Keys.D1); 
RegisterHotKey(thiswindow, (uint) WindowKeys.Alt, 2, (int)Keys.D2);

Now how do I differentiate between them using:

protected override void WndProc(ref Message keyPressed)
        {
            if (keyPressed.Msg == 0x0312)
            {
                if (alt+d1 is pressed)
                   //do something
                if (alt+d2 is pressed)
                   //do something
            }

            base.WndProc(ref keyPressed);
        }

I am doing this inside a WinForm project with user32.dll imported.

0

There are 0 answers