pub fn unbind_raw_event_handler(handler: &RawEventHandler) -> Result<(), NwgError>
{
    let subclass_proc = handler.subclass_proc;
    let handler_id = handler.handler_id;
    let handle = handler.handle;

    unsafe {
        let mut callback_value: UINT_PTR = 0;
        let result = GetWindowSubclass(handle, subclass_proc, handler_id, &mut callback_value);
        if result == 0 {
            let err = format!(concat!(
                "Could not fetch raw event handler #{:?}.",
                "This can happen if the control ({:?}) was freed or",
                "if this raw event handler was already unbound"
            ), handler_id, handle);
            return Err(NwgError::EventsBinding(err));
        }

        let callback_wrapper_ptr = callback_value as *mut *mut RawCallback;
        let callback_wrapper: Box<*mut RawCallback> = Box::from_raw(callback_wrapper_ptr);
        let callback: Box<RawCallback> = Box::from_raw(*callback_wrapper);
        mem::drop(callback);

        RemoveWindowSubclass(handle, subclass_proc, handler_id);
        Ok(())
    }
}
/**
    Remove the raw event handler from the associated window.
    Calling unbind twice or trying to unbind an handler after destroying its parent will cause the function to panic.
*/
Remove the raw event handler from the associated window.
Calling unbind twice or trying to unbind an handler after destroying its parent will cause the function to panic.
Remove the raw event handler from the associated window . Calling unbind twice or trying to unbind an handler after destroying its parent will cause the function to panic .
pub fn unbind_raw_event_handler(handler: &RawEventHandler) -> Result<(), NwgError>
{
    let subclass_proc = handler.subclass_proc;
    let handler_id = handler.handler_id;
    let handle = handler.handle;
    unsafe {
        let mut callback_value: UINT_PTR = 0;
        let result = GetWindowSubclass(handle, subclass_proc, handler_id, &mut callback_value);
        if result == 0 {
            let err = format!(concat!(
                "Could not fetch raw event handler #{:?}.",
                "This can happen if the control ({:?}) was freed or",
                "if this raw event handler was already unbound"
            ), handler_id, handle);
            return Err(NwgError::EventsBinding(err));
        }
        let callback_wrapper_ptr = callback_value as *mut *mut RawCallback;
        let callback_wrapper: Box<*mut RawCallback> = Box::from_raw(callback_wrapper_ptr);
        let callback: Box<RawCallback> = Box::from_raw(*callback_wrapper);
        mem::drop(callback);
        RemoveWindowSubclass(handle, subclass_proc, handler_id);
        Ok(())
    }
}
pub fn unbind_raw_event_handler ( handler : & RawEventHandler ) -> Result < ( ) , NwgError > { let subclass_proc = handler . subclass_proc ; let handler_id = handler . handler_id ; let handle = handler . handle ; unsafe { let mut callback_value : UINT_PTR = 0 ; let result = GetWindowSubclass ( handle , subclass_proc , handler_id , & mut callback_value ) ; if result == 0 { let err = format ! ( concat ( " " " " " " ) handler_id handle ) ; return Err ( NwgError :: EventsBinding ( err ) ) ; } let callback_wrapper_ptr = callback_value as * mut * mut RawCallback ; let callback_wrapper : Box < * mut RawCallback > = Box :: from_raw ( callback_wrapper_ptr ) ; let callback : Box < RawCallback > = Box :: from_raw ( * callback_wrapper ) ; mem :: drop ( callback ) ; RemoveWindowSubclass ( handle , subclass_proc , handler_id ) ; Ok ( ( ) ) } }
Remove the raw event handler from the associated window.
Remove the raw event handler from the associated window .
handler
&RawEventHandler