Exemple #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     NativeMethods.CHANGEFILTERSTRUCT changeFilter = new NativeMethods.CHANGEFILTERSTRUCT();
     changeFilter.size = (uint)Marshal.SizeOf(changeFilter);
     changeFilter.info = 0;
     if (!NativeMethods.ChangeWindowMessageFilterEx(this.Handle, NativeMethods.WM_COPYDATA, NativeMethods.ChangeWindowMessageFilterExAction.Allow, ref changeFilter))
     {
         int error = Marshal.GetLastWin32Error();
         MessageBox.Show(String.Format("The error {0} occured.", error));
     }
 }
 private void Form1_Load(object sender, EventArgs e)
 {
     NativeMethods.CHANGEFILTERSTRUCT changeFilter = new NativeMethods.CHANGEFILTERSTRUCT();
     changeFilter.size = (uint)Marshal.SizeOf(changeFilter);
     changeFilter.info = 0;
     if (!NativeMethods.ChangeWindowMessageFilterEx(this.Handle, NativeMethods.WM_COPYDATA, NativeMethods.ChangeWindowMessageFilterExAction.Allow, ref changeFilter))
     {
         int error = Marshal.GetLastWin32Error();
         MessageBox.Show(String.Format("The error {0} occured.", error));
     }
 }