Trait hwndloop::HwndLoopCallbacks
source · pub trait HwndLoopCallbacks<CommandType: Debug>: Send {
fn set_up(&mut self, hwnd: HWND) { ... }
fn tear_down(&mut self, hwnd: HWND) { ... }
fn handle_message(
&mut self,
hwnd: HWND,
msg: UINT,
w: WPARAM,
l: LPARAM
) -> LRESULT { ... }
fn handle_command(&mut self, hwnd: HWND, cmd: CommandType) { ... }
}
Expand description
Callbacks called by a HwndLoop
.
Provided Methods
sourcefn tear_down(&mut self, hwnd: HWND)
fn tear_down(&mut self, hwnd: HWND)
Called on the handler thread just before the HwndLoop
terminates.
Note that if you need to wait for a message to finish tearing down, it is too late by this point. The HWND and thread will be destroyed immediateliy after this function returns.
sourcefn handle_message(&mut self, hwnd: HWND, msg: UINT, w: WPARAM, l: LPARAM) -> LRESULT
fn handle_message(&mut self, hwnd: HWND, msg: UINT, w: WPARAM, l: LPARAM) -> LRESULT
Handle a Windows message.
Note that most messages need to have DefWindowProcA
called on them for cleanup.
sourcefn handle_command(&mut self, hwnd: HWND, cmd: CommandType)
fn handle_command(&mut self, hwnd: HWND, cmd: CommandType)
Handle a command sent via HwndLoop::send_command
.