Common Context Menu at application level

177 Views Asked by At

I have a very huge business application that contains almost all types of controls + third party controls. Now I have a requirement where I have to open a Form on "ctrl + double click" on any control(grid, cell, row, treenode, button, etc.. etc..)..

Is it possible in Winforms C#.Net.

I tried with this code as well but it didn't help

const int WM_LBUTTONDBLCLK = 0x0203;//client area
const int WM_NCLBUTTONDBLCLK = 0x00A3;//non-client area
protected override void WndProc(ref Message m)
{
  if (m.Msg == WM_LBUTTONDBLCLK)
    return;
  if (m.Msg == WM_NCLBUTTONDBLCLK)
    return;
  base.WndProc(ref m);
}

I am not sure if I can create a Common Context Menu at application level Thanks.

1

There are 1 best solutions below

0
On

You will have to use keyboard and mouse hooks for that.

Here are some great articles that will get you started.

Processing Global Mouse and Keyboard Hooks in C#

And

WPF, low-level keyboard hook sample