private MobileWndProc _formProc; // object's delegate /// <summary> /// subclass the window /// </summary> void subclassThisForm(IntPtr hwnd) { _formProc = new MobileWndProc(formWindowProc); _origFormWndProc = (IntPtr)NativeWindowCommon.SetWindowLong(hwnd, NativeWindowCommon.GWL_WNDPROC, Marshal.GetFunctionPointerForDelegate(_formProc).ToInt32()); }
/// <summary> subclass the combobox - replace it's window proce /// </summary> void subclassCombobox() { proc = new MobileWndProc(WindowProc); OrigWndProc = (IntPtr)NativeWindowCommon.SetWindowLong(Handle, NativeWindowCommon.GWL_WNDPROC, Marshal.GetFunctionPointerForDelegate(proc).ToInt32()); }
//This is usually where the control handle is created - subclass void TableControl_HandleCreated(object sender, EventArgs e) { proc = new MobileWndProc(WindowProc); OrigWndProc = (IntPtr)NativeWindowCommon.SetWindowLong(Handle, NativeWindowCommon.GWL_WNDPROC, Marshal.GetFunctionPointerForDelegate(proc).ToInt32()); }