コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        public void Detach(ComboBox control)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            MessageHook.UnSubclass(control.Parent.Handle, Callback);
            Handle = IntPtr.Zero;
        }
コード例 #2
0
ファイル: MessageHook.cs プロジェクト: usausa/Smart-Net-CE
 /// <summary>
 ///
 /// </summary>
 /// <param name="handle"></param>
 /// <param name="callback"></param>
 public static void Subclass(IntPtr handle, WndProcCallback callback)
 {
     MessageHook messageHook;
     if (Hooks.TryGetValue(handle, out messageHook))
     {
         messageHook.AddHook(callback);
     }
     else
     {
         messageHook = new MessageHook(handle);
         Hooks[handle] = messageHook;
         messageHook.AddHook(callback);
     }
 }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="handle"></param>
 /// <param name="callback"></param>
 public static void Subclass(IntPtr handle, WndProcCallback callback)
 {
     MessageHook messageHook;
     if (Hooks.TryGetValue(handle, out messageHook))
     {
         messageHook.AddHook(callback);
     }
     else
     {
         messageHook = new MessageHook(handle);
         Hooks[handle] = messageHook;
         messageHook.AddHook(callback);
     }
 }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        public void Attach(ComboBox control)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            if (Handle != IntPtr.Zero)
            {
                throw new InvalidOperationException("behavior is attached");
            }

            Handle = control.Handle;
            MessageHook.Subclass(control.Parent.Handle, Callback);
        }