Skip to content

Instantly share code, notes, and snippets.

@greatcodeeer
Last active August 16, 2020 09:57

Revisions

  1. codeeer revised this gist Jul 18, 2014. No changes.
  2. codeeer created this gist Jul 18, 2014.
    5 changes: 5 additions & 0 deletions 热键 Alt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
    {
    if ((Keys.Alt & keyData) == Keys.Alt) MessageBox.Show("1");
    return base.ProcessCmdKey(ref msg, keyData);
    }
    17 changes: 17 additions & 0 deletions 热键 Alt+D
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
    {
    const int WM_KEYDOWN = 0x100;
    const int WM_SYSKEYDOWN = 0x104;

    if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
    {
    switch (keyData)
    {
    case Keys.Alt | Keys.D:
    MessageBox.Show("ALT+D~");
    break;
    }
    }

    return base.ProcessCmdKey(ref msg, keyData);
    }