// setup window public Window() { _wndProcReferece = WndProc; if (RegisterClass() == 0) { return; } if (Create() == 0) { return; } }
public MessageWindow() { _wndProc = WndProc; handlers = new Dictionary <Win32.WindowMessages, Action <IntPtr, Win32.WindowMessages, IntPtr, IntPtr> >(); var wnd = new Win32.WNDCLASSEX { cbSize = (uint)Marshal.SizeOf <Win32.WNDCLASSEX>(), hInstance = Process.GetCurrentProcess().Handle, lpszClassName = WndClass, lpfnWndProc = _wndProc }; Win32.RegisterClassEx(ref wnd); WindowHandle = Win32.CreateWindowEx(Win32.WindowStylesEx.WS_EX_LEFT, WndClass, WndClass, Win32.WindowStyles.WS_OVERLAPPED, 0, 0, 0, 0, Win32.HWND_MESSAGE, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); }
/// <summary> /// Constructs a new HookedProcInformation object /// </summary> /// <param name="ctl">The handle to the window being hooked</param> /// <param name="wndproc">The window procedure to replace the /// original one for the control</param> public HookedProcInformation(Control ctl, Win32.WndProc wndproc) { control = ctl; newWndProc = wndproc; messageMap = new Dictionary <uint, WndProcCallback>(); }
// Constructs a new HookedProcInformation object // Parameters: // ctl - The handle to the window being hooked // wndproc - The window procedure to replace the // original one for the control. public HookedProcInformation(Control ctl, Win32.WndProc wndproc) { control = ctl; newWndProc = wndproc; messageMap = new Dictionary<uint, WndProcCallback>(); }