public static void RemoveHandler(Form form) { if (form == null) { return; } WndProcHookForm f = null; m_forms.TryGetValue(form, out f); if (f != null) { f.Cleanup(); } m_forms.Remove(form); }
public static void RemoveHandler(Form form, EventHandler <WndProcEventArgs> handler) { if (form == null) { return; } WndProcHookForm f = null; bool found = m_forms.TryGetValue(form, out f); if (!found) { return; } f.WndProcEvent -= handler; }
public static bool AddHandler(Form form, EventHandler <WndProcEventArgs> handler) { if (form == null) { return(false); } WndProcHookForm f = null; m_forms.TryGetValue(form, out f); if (f == null) { f = new WndProcHookForm(form); m_forms[form] = f; } f.WndProcEvent += handler; return(true); }