Beispiel #1
0
        public WindowHook(TodayScreenItem item, Control control)
        {
            this.item = item;
              this.control = control;

              // Subclass the window procedure associated with this control, so that
              // we can hook the requests to paint it's background
              newWindowProc = new WindowProcCallback(WndProc);
              realWindowProc = SetWindowLong(control.Handle, GWL_WNDPROC, Marshal.GetFunctionPointerForDelegate(newWindowProc));
        }
Beispiel #2
0
 internal static extern int SetWindowLong(IntPtr hWnd, int index, WindowProcCallback del);
 public static extern IntPtr SetWindowLong(IntPtr hWnd, int nIndex, WindowProcCallback callback);
Beispiel #4
0
			public static extern IntPtr SetWindowLong(IntPtr hWnd, int nIndex, WindowProcCallback callback);
 protected override void OnHandleCreated(EventArgs e)
 {
     if (this.m_wndproc == IntPtr.Zero)
     {
         this.m_delegate = new WindowProcCallback(this.WindowProc);
         this.m_wndproc = Marshal.GetFunctionPointerForDelegate(this.m_delegate);
     }
     try
     {
         this.m_wndprocReal = SetWindowLong(base.Handle, -4, this.m_wndproc);
     }
     catch
     {
     }
     base.OnHandleCreated(e);
 }
Beispiel #6
0
 internal static extern int SetWindowLong(IntPtr hWnd, int index, WindowProcCallback del);