What are RegisterHotKeys
and global keyboard h开发者_如何学JAVAooks, and how do they work?
I want to make a key to get focused on my application's Form (when it's minimized) and then focus on a textbox, so from what I've read I need to use the RegisterHotKeys
function (that's a better solution for my needs), but i couldn't find how or where I can choose my own key (only one key - ESC) and then command it to focus on my form, and then on the textbox.
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);
}
}
精彩评论