RegisterHotKeys and global keyboard hooks?

前端 未结 1 773
执笔经年
执笔经年 2021-01-15 18:19

What are RegisterHotKeys and global keyboard hooks, and how do they work?

I want to make a key to get focused on my application\'s Form (when it\'s mini

1条回答
  •  旧时难觅i
    2021-01-15 19:12

    Sample on how to use hot keys.

    class myform : Form
    {
        public myform()
        {
            RegisterHotKey(Handle, id, modifiers, mykey);
        }
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == 0x312) // this is WM_HOTKEY
            {
                Show();
            }
            base.WndProc(ref m);
        }
    }
    

    0 讨论(0)
提交回复
热议问题