I have a method as follows:
public static void RegisterForMessage(System.Windows.Window window, Action action)
{
HwndSource hWndSource;
WindowInteropHelper wih = new WindowInteropHelper(window);
hWndSource = HwndSource.FromHwnd(wih.Handle);
hWndSource.AddHook(hwndSourceHook);
}
i want to take action from user and pass into hwndSourceHook method:
private static IntPtr hwndSourceHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
// Action must be run here
return IntPtr.Zero;
}
but i dont know how to do this