Tsukikage.WindowsUtil.WindowSubclassingMessageFilter.WindowSubclassingMessageFilter C# (CSharp) Method

WindowSubclassingMessageFilter() public method

public WindowSubclassingMessageFilter ( IntPtr hWnd ) : System
hWnd System.IntPtr
return System
        public WindowSubclassingMessageFilter(IntPtr hWnd)
        {
            if (!Win32.IsWindow(hWnd)) { throw new ArgumentException(); }
            this.procs = new Dictionary<int, MessageProc>();
            this.hWnd = hWnd;
            this.newWndProcDelegate = this.WndProc;
            this.newWndProc = Marshal.GetFunctionPointerForDelegate(newWndProcDelegate);
            this.oldWndProc = Win32.GetWindowLong(hWnd, -4);
            Win32.SetWindowLong(hWnd, -4, newWndProc);
        }